mirror of
https://github.com/elk-zone/elk
synced 2024-11-27 22:38:11 +09:00
1aa118283e
Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
22 lines
556 B
TypeScript
22 lines
556 B
TypeScript
import type { FeatureFlags } from './featureFlags'
|
|
import type { ColorMode, FontSize } from '~/types'
|
|
import { STORAGE_KEY_SETTINGS } from '~/constants'
|
|
|
|
export interface UserSettings {
|
|
featureFlags: Partial<FeatureFlags>
|
|
colorMode?: ColorMode
|
|
fontSize?: FontSize
|
|
lang?: string
|
|
zenMode?: boolean
|
|
}
|
|
|
|
export function getDefaultUserSettings(): UserSettings {
|
|
return {
|
|
featureFlags: {},
|
|
}
|
|
}
|
|
|
|
export const userSettings = process.server
|
|
? computed(getDefaultUserSettings)
|
|
: useUserLocalStorage(STORAGE_KEY_SETTINGS, getDefaultUserSettings)
|