enhance: embedページではstoreの保存先を完全に分離するように

This commit is contained in:
kakkokari-gtyih
2024-06-01 21:03:39 +09:00
parent ecf7945fe8
commit e9b3b5ffcd
13 changed files with 168 additions and 23 deletions

View File

@@ -9,10 +9,19 @@ import 'vite/modulepreload-polyfill';
import '@/style.scss';
import { mainBoot } from '@/boot/main-boot.js';
import { subBoot } from '@/boot/sub-boot.js';
import { isEmbedPage } from '@/scripts/embed-page.js';
const subBootPaths = ['/share', '/auth', '/miauth', '/signup-complete'];
const subBootPaths = ['/share', '/auth', '/miauth', '/signup-complete', '/embed'];
if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) {
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' });
}
}
subBoot();
} else {
mainBoot();