From 14e0d1f2528a53126457ceaf9468a4b08769b16c Mon Sep 17 00:00:00 2001 From: FruitRiin Date: Sun, 19 Nov 2023 18:47:27 +0900 Subject: [PATCH] fix theme --- packages/frontend/src/boot/common.ts | 6 ++++++ packages/frontend/vite.config.ts | 16 ++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 12bb56a874..30bc0f5219 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -187,6 +187,12 @@ export async function common(createVue: () => App) { if (instance.defaultLightTheme != null) ColdDeviceStorage.set('lightTheme', JSON.parse(instance.defaultLightTheme)); if (instance.defaultDarkTheme != null) ColdDeviceStorage.set('darkTheme', JSON.parse(instance.defaultDarkTheme)); defaultStore.set('themeInitial', false); + } else { + if (defaultStore.state.darkMode) { + applyTheme(darkTheme.value); + } else { + applyTheme(lightTheme.value); + } } }); diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts index 067b4fab1e..ee96c50128 100644 --- a/packages/frontend/vite.config.ts +++ b/packages/frontend/vite.config.ts @@ -52,20 +52,16 @@ export function getConfig(): UserConfig { changeOrigin: true, target: 'http://127.0.0.1:3000/', }, - - '/assets': { - target: 'http://127.0.0.1:3000/', - }, - '/twemoji': { - target: 'http://127.0.0.1:3000/', - }, - '/sw.js': { - target: 'http://127.0.0.1:3000/', - }, + '/assets': 'http://127.0.0.1:3000/', + '/twemoji': 'http://127.0.0.1:3000/', + '/fluent-emoji': 'http://127.0.0.1:3000/', + '/sw.js': 'http://127.0.0.1:3000/', '/streaming': { target: 'ws://127.0.0.1:3000/', ws: true, }, + "favicon.ico": 'http://127.0.0.1:3000/', + "client-assets": "http://127.0.0.1:3000/" } },