From 4a53de4466ee55e55baabe2924dd812aff8590cc Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 29 Nov 2023 10:50:05 +0100 Subject: [PATCH] Lazy load language picker in auth and onboarding (#18806) --- src/auth/ha-authorize.ts | 3 ++- src/onboarding/ha-onboarding.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auth/ha-authorize.ts b/src/auth/ha-authorize.ts index 78360f8e3e..fb0bebc685 100644 --- a/src/auth/ha-authorize.ts +++ b/src/auth/ha-authorize.ts @@ -5,7 +5,6 @@ import punycode from "punycode"; import { applyThemesOnElement } from "../common/dom/apply_themes_on_element"; import { extractSearchParamsObject } from "../common/url/search-params"; import "../components/ha-alert"; -import "../components/ha-language-picker"; import { AuthProvider, AuthUrlSearchParams, @@ -274,6 +273,8 @@ export class HaAuthorize extends litLocalizeLiteMixin(LitElement) { this._ownInstance = true; registerServiceWorker(this, false); } + + import("../components/ha-language-picker"); } protected updated(changedProps: PropertyValues) { diff --git a/src/onboarding/ha-onboarding.ts b/src/onboarding/ha-onboarding.ts index 164d6c931e..b30fd33b24 100644 --- a/src/onboarding/ha-onboarding.ts +++ b/src/onboarding/ha-onboarding.ts @@ -22,7 +22,6 @@ import { } from "../common/url/search-params"; import { subscribeOne } from "../common/util/subscribe-one"; import "../components/ha-card"; -import "../components/ha-language-picker"; import { AuthUrlSearchParams, hassUrl } from "../data/auth"; import { OnboardingResponses, @@ -222,6 +221,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) { import("./particles"); } makeDialogManager(this, this.shadowRoot!); + import("../components/ha-language-picker"); } protected updated(changedProps: PropertyValues) {