Skip to content

Commit

Permalink
Fix other locale undefined issue (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
decompil3d committed Aug 3, 2022
1 parent 02ccf9f commit 8d9cb7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hourly-weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class HourlyWeatherCard extends LitElement {

if (changedProps.has('hass')) {
const oldHass = changedProps.get('hass') as HomeAssistant;
if (JSON.stringify(oldHass.locale) !== JSON.stringify(this.hass.locale)) {
if (oldHass && this.hass && JSON.stringify(oldHass.locale) !== JSON.stringify(this.hass.locale)) {
// Locale changed, so we must re-render
return true;
}
Expand Down

0 comments on commit 8d9cb7c

Please sign in to comment.