feat(settings): respect settings from server (#1013)
This commit is contained in:
parent
32aa47e701
commit
9a41b9b7d7
27 changed files with 230 additions and 167 deletions
|
@ -1,24 +1,2 @@
|
|||
import type { FeatureFlags } from './featureFlags'
|
||||
import type { WellnessSettings } from './wellness'
|
||||
import type { ColorMode, FontSize } from '~/types'
|
||||
import { STORAGE_KEY_SETTINGS } from '~/constants'
|
||||
|
||||
export interface UserSettings {
|
||||
featureFlags: Partial<FeatureFlags>
|
||||
wellnessSettings: Partial<WellnessSettings>
|
||||
colorMode?: ColorMode
|
||||
fontSize?: FontSize
|
||||
lang?: string
|
||||
zenMode?: boolean
|
||||
}
|
||||
|
||||
export function getDefaultUserSettings(): UserSettings {
|
||||
return {
|
||||
featureFlags: {},
|
||||
wellnessSettings: {},
|
||||
}
|
||||
}
|
||||
|
||||
export const userSettings = process.server
|
||||
? computed(getDefaultUserSettings)
|
||||
: useUserLocalStorage(STORAGE_KEY_SETTINGS, getDefaultUserSettings)
|
||||
export * from './definition'
|
||||
export * from './storage'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue