Skip to content

Commit

Permalink
Follow up comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh committed Nov 2, 2023
1 parent 876f3a1 commit dada7f7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/state/connection-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,14 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
}
if (notifyOnError) {
forwardHaptic("failure");
const lokalize = await this.hass?.loadBackendTranslation(
const lokalize = await this.hass!.loadBackendTranslation(
"exceptions",
domain
);
const localizedErrorMessage =
lokalize &&
lokalize(
`component.${err.translation_domain}.exceptions.${err.translation_key}.message`,
err.translation_placeholders
);
const localizedErrorMessage = lokalize(
`component.${err.translation_domain}.exceptions.${err.translation_key}.message`,
err.translation_placeholders
);
const message =
localizedErrorMessage ||
(this as any).hass.localize(
Expand Down

0 comments on commit dada7f7

Please sign in to comment.