Load the Intl.Segmenter and Intl.DurationFormat polyfills only if needed (#2778)
* Load the Intl.Segmenter polyfill only if needed * Also polyfill Intl.DurationFormat only if needed * Polyfill Intl.* in tests * Load the default translations in tests * Instanciate the Intl.DurationFormat in the component
This commit is contained in:
23
src/main.tsx
23
src/main.tsx
@@ -20,8 +20,6 @@ import {
|
||||
setLogExtension as setLKLogExtension,
|
||||
setLogLevel as setLKLogLevel,
|
||||
} from "livekit-client";
|
||||
import "@formatjs/intl-segmenter/polyfill";
|
||||
import "@formatjs/intl-durationformat/polyfill";
|
||||
|
||||
import { App } from "./App";
|
||||
import { init as initRageshake } from "./settings/rageshake";
|
||||
@@ -57,12 +55,17 @@ if (fatalError !== null) {
|
||||
throw fatalError; // Stop the app early
|
||||
}
|
||||
|
||||
Initializer.initBeforeReact();
|
||||
Initializer.initBeforeReact()
|
||||
.then(() => {
|
||||
const history = createBrowserHistory();
|
||||
|
||||
const history = createBrowserHistory();
|
||||
|
||||
root.render(
|
||||
<StrictMode>
|
||||
<App history={history} />
|
||||
</StrictMode>,
|
||||
);
|
||||
root.render(
|
||||
<StrictMode>
|
||||
<App history={history} />
|
||||
</StrictMode>,
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
logger.error("Failed to initialize app", e);
|
||||
root.render(e.message);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user