mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-04 01:10:33 -06:00
Fix intl polyfill loading (#27261)
This commit is contained in:
parent
6823c647b6
commit
994c1b5751
@ -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<unknown>[] = [];
|
||||
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)
|
||||
);
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user