mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Always define localize func (#1830)
This commit is contained in:
parent
3b1b2b95e7
commit
0fdd1c74f2
@ -11,6 +11,8 @@ import {
|
||||
LocalizeMixin,
|
||||
} from "./localize-base-mixin";
|
||||
|
||||
const empty = () => "";
|
||||
|
||||
export const HassLocalizeLitMixin = <T extends LitElement>(
|
||||
superClass: Constructor<T>
|
||||
): Constructor<T & LocalizeMixin> =>
|
||||
@ -26,6 +28,12 @@ export const HassLocalizeLitMixin = <T extends LitElement>(
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
// This will prevent undefined errors if called before connected to DOM.
|
||||
this.localize = empty;
|
||||
}
|
||||
|
||||
public connectedCallback(): void {
|
||||
super.connectedCallback();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user