diff options
| author | pany <[email protected]> | 2023-08-21 17:15:12 +0800 |
|---|---|---|
| committer | pany <[email protected]> | 2023-08-21 17:15:12 +0800 |
| commit | 82c3409b7df260f3723bd2c690ccc90165c74986 (patch) | |
| tree | 99cc5bebf68ae680d8cfb6d22dd7d28d93b5cfc4 | |
| parent | 30ec43d4904d967ed7b7a694bce708a0f4ebb59c (diff) | |
fix: 解决项目配置的缓存项少于实际所需项数时导致的页面空白问题
| -rw-r--r-- | src/config/layouts.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/config/layouts.ts b/src/config/layouts.ts index 8d95cdf..8728431 100644 --- a/src/config/layouts.ts +++ b/src/config/layouts.ts @@ -1,6 +1,6 @@ import { getConfigLayout } from "@/utils/cache/local-storage" -/** 项目配置 */ +/** 项目配置类型 */ export interface LayoutSettings { /** 是否显示 Settings Panel */ showSettings: boolean @@ -28,7 +28,8 @@ export interface LayoutSettings { showColorWeakness: boolean } -export const layoutSettings: LayoutSettings = getConfigLayout() ?? { +/** 默认配置 */ +const defaultSettings: LayoutSettings = { layoutMode: "left", showSettings: true, showTagsView: true, @@ -42,3 +43,6 @@ export const layoutSettings: LayoutSettings = getConfigLayout() ?? { showGreyMode: false, showColorWeakness: false } + +/** 项目配置 */ +export const layoutSettings: LayoutSettings = { ...defaultSettings, ...getConfigLayout() } |
