From aa5eb9c43b3ce9ad3774d4123a04b7af717e2331 Mon Sep 17 00:00:00 2001 From: Samidy Date: Sat, 20 Dec 2025 15:09:56 +0300 Subject: [PATCH] i saved theme data locally fuck --- docs/.vitepress/theme/components/ColorPicker.vue | 2 +- docs/.vitepress/theme/themes/themeHandler.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/.vitepress/theme/components/ColorPicker.vue b/docs/.vitepress/theme/components/ColorPicker.vue index efafa54ba..6f671abe8 100644 --- a/docs/.vitepress/theme/components/ColorPicker.vue +++ b/docs/.vitepress/theme/components/ColorPicker.vue @@ -260,4 +260,4 @@ const toggleAmoled = () => { - + \ No newline at end of file diff --git a/docs/.vitepress/theme/themes/themeHandler.ts b/docs/.vitepress/theme/themes/themeHandler.ts index 4dcbd02ca..eb8ce5a29 100644 --- a/docs/.vitepress/theme/themes/themeHandler.ts +++ b/docs/.vitepress/theme/themes/themeHandler.ts @@ -21,6 +21,7 @@ import { themeRegistry } from './configs' const STORAGE_KEY_THEME = 'vitepress-theme-name' const STORAGE_KEY_MODE = 'vitepress-display-mode' const STORAGE_KEY_AMOLED = 'vitepress-amoled-enabled' +const STORAGE_KEY_THEME_DATA = 'vitepress-theme-data' export class ThemeHandler { private state = ref({ @@ -45,10 +46,6 @@ export class ThemeHandler { if (themeRegistry[savedTheme]) { this.state.value.currentTheme = savedTheme this.state.value.theme = themeRegistry[savedTheme] - } else { - localStorage.removeItem(STORAGE_KEY_THEME) - this.state.value.currentTheme = 'christmas' - this.state.value.theme = themeRegistry.christmas } // Set amoled preference @@ -77,7 +74,7 @@ export class ThemeHandler { }) } - private applyTheme() { + public applyTheme() { if (typeof document === 'undefined') return const { currentMode, theme } = this.state.value @@ -393,4 +390,4 @@ export function useTheme() { toggleAmoled: () => handler.toggleAmoled(), state } -} \ No newline at end of file +}