Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect state display being cached #2356

Merged
merged 2 commits into from Dec 19, 2018
Merged

Fix incorrect state display being cached #2356

merged 2 commits into from Dec 19, 2018

Conversation

balloob
Copy link
Member

@balloob balloob commented Dec 18, 2018

The UI would render states before this.hass.resources was loaded. This caused the rendering of the computed state domain to use the fallback value (the state) and cache that in stateObj._stateDisplay. After resources were done loading, we didn't clear this cache and so users would see incorrect translated states until the state would change.

This PR removes the caching in stateObj._stateDisplay and stateObj._entityDisplay.

This PR is best reviewed by ignoring whitespace

Fixes #2354

This might break some custom UI that was using the cache to inject their own values. With Lovelace there are now alternative ways to do this with possibilities to inject custom elements as entity rows, cards, views.

CC @andrey-git

@ghost ghost assigned balloob Dec 18, 2018
@ghost ghost added the in progress label Dec 18, 2018
@balloob balloob merged commit 49fa74c into dev Dec 19, 2018
@delete-merged-branch delete-merged-branch bot deleted the fix-translations branch December 19, 2018 12:05
@ghost ghost removed the in progress label Dec 19, 2018
balloob added a commit that referenced this pull request Dec 19, 2018
* Fix incorrect state display being cached

* Remove test for cache
@balloob balloob mentioned this pull request Dec 19, 2018
@andrey-git
Copy link
Contributor

This removes the ability to have an empty name. I will send a PR to re-allow it.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.84 Lovelace lost translations
3 participants