From 994c1b5751dd60a3aaad8d192ddd31aabb89d428 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 30 Sep 2025 15:47:12 +0200 Subject: [PATCH] Fix intl polyfill loading (#27261) --- src/resources/polyfills/intl-polyfill.ts | 12 ++++++++++-- src/resources/theme/core.globals.ts | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/resources/polyfills/intl-polyfill.ts b/src/resources/polyfills/intl-polyfill.ts index 97026fdbaf..ddc02f16a8 100644 --- a/src/resources/polyfills/intl-polyfill.ts +++ b/src/resources/polyfills/intl-polyfill.ts @@ -14,7 +14,15 @@ import { polyfillTimeZoneData, } from "./locale-data-polyfill"; +let polyfilled = false; + +const _polyfillTimeZoneData = polyfillTimeZoneData; + const polyfillIntl = async () => { + if (polyfilled) { + return; + } + polyfilled = true; const locale = getLocalLanguage(); const polyfills: Promise[] = []; if (shouldPolyfillGetCanonicalLocales()) { @@ -26,7 +34,7 @@ const polyfillIntl = async () => { if (shouldPolyfillDateTimeFormat(locale)) { polyfills.push( import("@formatjs/intl-datetimeformat/polyfill-force").then(() => - polyfillTimeZoneData() + _polyfillTimeZoneData() ) ); } @@ -58,7 +66,7 @@ const polyfillIntl = async () => { if (polyfills.length === 0) { return; } - await Promise.all(polyfills).then(() => + await Promise.allSettled(polyfills).then(() => // Load the default language polyfillLocaleData(locale) ); diff --git a/src/resources/theme/core.globals.ts b/src/resources/theme/core.globals.ts index c44784488a..9bcfdd6603 100644 --- a/src/resources/theme/core.globals.ts +++ b/src/resources/theme/core.globals.ts @@ -19,8 +19,8 @@ export const coreStyles = css` --ha-border-radius-pill: 9999px; --ha-border-radius-circle: 50%; --ha-border-radius-square: 0; - - # Spacing + + /* Spacing */ --ha-space-0: 0px; --ha-space-1: 4px; --ha-space-2: 8px;