2021-03-26 04:17:02 +04:30
|
|
|
/*
|
|
|
|
|
* 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
|
2023-05-18 13:17:41 +02:00
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
2021-01-26 23:32:12 +03:30
|
|
|
|
2023-08-14 21:43:06 +02:00
|
|
|
import { StrictMode } from 'react';
|
2023-06-04 21:40:04 +02:00
|
|
|
import { createRoot } from 'react-dom/client';
|
2024-05-02 22:14:08 +02:00
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
2023-10-28 00:32:02 +02:00
|
|
|
import { App } from '@/App';
|
2023-06-05 01:42:39 +02:00
|
|
|
import '@/index.css';
|
2020-12-24 15:02:03 +03:30
|
|
|
// roboto font
|
2021-05-13 17:46:40 +04:30
|
|
|
import '@fontsource/roboto';
|
2024-04-09 23:37:41 +02:00
|
|
|
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
2024-05-02 22:14:34 +02:00
|
|
|
import { loadDayJsLocale } from '@/util/language.tsx';
|
2024-04-09 23:37:41 +02:00
|
|
|
|
2024-05-02 22:14:08 +02:00
|
|
|
dayjs.extend(customParseFormat);
|
|
|
|
|
|
2024-05-02 22:14:34 +02:00
|
|
|
loadDayJsLocale(navigator.language).then(() => {
|
|
|
|
|
dayjs.locale(navigator.language);
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-09 23:37:41 +02:00
|
|
|
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
|
|
|
|
2023-06-04 21:40:04 +02:00
|
|
|
const container = document.getElementById('root');
|
|
|
|
|
const root = createRoot(container!);
|
|
|
|
|
root.render(
|
2023-08-14 21:43:06 +02:00
|
|
|
<StrictMode>
|
2020-12-24 16:50:50 +01:00
|
|
|
<App />
|
2023-08-14 21:43:06 +02:00
|
|
|
</StrictMode>,
|
2020-12-24 02:37:23 +03:30
|
|
|
);
|