From dada7f7eb43fe371aad8192055eab98c2b99421b Mon Sep 17 00:00:00 2001 From: jbouwh Date: Thu, 2 Nov 2023 22:16:34 +0000 Subject: [PATCH] Follow up comment --- src/state/connection-mixin.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/state/connection-mixin.ts b/src/state/connection-mixin.ts index e578f2b230e1..01cd4985c754 100644 --- a/src/state/connection-mixin.ts +++ b/src/state/connection-mixin.ts @@ -122,16 +122,14 @@ export const connectionMixin = >( } 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(