mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-08-02 20:18:01 +00:00
feat: 侧边栏记录
This commit is contained in:
18
src/store/modules/app/helper.ts
Normal file
18
src/store/modules/app/helper.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ls } from '@/utils/storage'
|
||||
|
||||
export interface AppState {
|
||||
siderCollapsed: boolean
|
||||
}
|
||||
|
||||
export function defaultSetting() {
|
||||
return { siderCollapsed: false }
|
||||
}
|
||||
|
||||
export function getAppSetting() {
|
||||
const localSetting: AppState = ls.get('appSetting')
|
||||
return localSetting ?? defaultSetting()
|
||||
}
|
||||
|
||||
export function setAppSetting(setting: AppState) {
|
||||
ls.set('appSetting', setting)
|
||||
}
|
Reference in New Issue
Block a user