Files
suwayomi-material-you-webui/src/index.tsx

44 lines
1.3 KiB
TypeScript
Raw Normal View History

/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
2021-01-26 23:32:12 +03:30
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
2021-01-26 23:32:12 +03:30
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
2023-10-28 00:32:02 +02:00
import { App } from '@/App';
import '@/index.css';
2020-12-24 15:02:03 +03:30
// roboto font
import '@fontsource/roboto';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
2024-05-02 22:14:34 +02:00
import { loadDayJsLocale } from '@/util/language.tsx';
dayjs.extend(customParseFormat);
2024-05-02 22:14:34 +02:00
loadDayJsLocale(navigator.language).then(() => {
dayjs.locale(navigator.language);
});
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then((registration) => {
registration.unregister().catch(defaultPromiseErrorHandler('unregister service workers'));
if (caches) {
caches.keys().then(async (names) => {
await Promise.all(names.map((name) => caches.delete(name)));
});
}
});
}
2020-12-24 15:02:03 +03:30
const container = document.getElementById('root');
const root = createRoot(container!);
root.render(
<StrictMode>
2020-12-24 16:50:50 +01:00
<App />
</StrictMode>,
);