diff --git a/src/hooks/useTheme.ts b/src/hooks/useTheme.ts index 6ab392e..0ca28a2 100644 --- a/src/hooks/useTheme.ts +++ b/src/hooks/useTheme.ts @@ -1,5 +1,5 @@ import { ref, watchEffect } from "vue" -import { getActiveThemeName, setActiveThemeName } from "@/utils/cache/localStorage" +import { getActiveThemeName, setActiveThemeName } from "@/utils/cache/local-storage" const DEFAULT_THEME_NAME = "normal" type DefaultThemeName = typeof DEFAULT_THEME_NAME diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 06e0d0a..d9db89c 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -1,6 +1,6 @@ import { reactive, ref, watch } from "vue" import { defineStore } from "pinia" -import { getSidebarStatus, setSidebarStatus } from "@/utils/cache/localStorage" +import { getSidebarStatus, setSidebarStatus } from "@/utils/cache/local-storage" import { DeviceEnum, SIDEBAR_OPENED, SIDEBAR_CLOSED } from "@/constants/app-key" interface Sidebar { diff --git a/src/utils/cache/localStorage.ts b/src/utils/cache/local-storage.ts similarity index 98% rename from src/utils/cache/localStorage.ts rename to src/utils/cache/local-storage.ts index 7b601ef..639b769 100644 --- a/src/utils/cache/localStorage.ts +++ b/src/utils/cache/local-storage.ts @@ -12,7 +12,7 @@ export const setSidebarStatus = (sidebarStatus: SidebarOpened | SidebarClosed) = } export const getActiveThemeName = () => { - return localStorage.getItem(CacheKey.ACTIVE_THEME_NAME) as ThemeName + return localStorage.getItem(CacheKey.ACTIVE_THEME_NAME) as ThemeName | null } export const setActiveThemeName = (themeName: ThemeName) => { localStorage.setItem(CacheKey.ACTIVE_THEME_NAME, themeName)