2023-07-27 07:31:52 +02:00
|
|
|
/*
|
2024-02-13 16:59:27 +01:00
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-05-15 12:08:46 +02:00
|
|
|
// https://vitejs.dev/config/build-options.html#build-modulepreload
|
|
|
|
import 'vite/modulepreload-polyfill';
|
|
|
|
|
|
|
|
import '@/style.scss';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { mainBoot } from '@/boot/main-boot.js';
|
|
|
|
import { subBoot } from '@/boot/sub-boot.js';
|
2024-06-01 14:03:39 +02:00
|
|
|
import { isEmbedPage } from '@/scripts/embed-page.js';
|
2023-05-15 12:08:46 +02:00
|
|
|
|
2024-06-01 14:03:39 +02:00
|
|
|
const subBootPaths = ['/share', '/auth', '/miauth', '/signup-complete', '/embed'];
|
2023-05-24 02:43:38 +02:00
|
|
|
|
|
|
|
if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) {
|
2024-06-01 14:03:39 +02:00
|
|
|
if (isEmbedPage()) {
|
|
|
|
const params = new URLSearchParams(location.search);
|
|
|
|
const color = params.get('color');
|
|
|
|
if (color && ['light', 'dark'].includes(color)) {
|
|
|
|
subBoot({ forceColorMode: color as 'light' | 'dark' });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-15 12:08:46 +02:00
|
|
|
subBoot();
|
|
|
|
} else {
|
|
|
|
mainBoot();
|
|
|
|
}
|