diff options
| author | xuatz <xzlow10@gmail.com> | 2025-07-17 17:24:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-17 09:24:33 +0100 |
| commit | fe69ca8ce88b51b0117aebfbb512fef16b4ebb35 (patch) | |
| tree | 32b8e96940b8a9de1ffe433347f95f33a47a8614 /apps/mobile/lib/settings.ts | |
| parent | a3627569466677d3c0f585af3e04b7ce7a14249f (diff) | |
| download | karakeep-fe69ca8ce88b51b0117aebfbb512fef16b4ebb35.tar.zst | |
feat(mobile): Add user setting for default bookmark view mode (#1723)
* feat(mobile): add user setting for default bookmark view mode
* regen db migration script
* clean up implementation
* Update docs/docs/07-Development/01-setup.md
* Update GEMINI.md
* use local setting instead of storing value in db
* improve start-dev.sh to also handle for db migration
* rename mobileBookmarkClickDefaultViewMode to defaultBookmarkView for consistency
Diffstat (limited to 'apps/mobile/lib/settings.ts')
| -rw-r--r-- | apps/mobile/lib/settings.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/mobile/lib/settings.ts b/apps/mobile/lib/settings.ts index 58b0817f..51fa661f 100644 --- a/apps/mobile/lib/settings.ts +++ b/apps/mobile/lib/settings.ts @@ -10,6 +10,10 @@ const zSettingsSchema = z.object({ address: z.string(), imageQuality: z.number().optional().default(0.2), theme: z.enum(["light", "dark", "system"]).optional().default("system"), + defaultBookmarkView: z + .enum(["reader", "browser"]) + .optional() + .default("reader"), }); export type Settings = z.infer<typeof zSettingsSchema>; @@ -23,7 +27,12 @@ interface AppSettingsState { const useSettings = create<AppSettingsState>((set, get) => ({ settings: { isLoading: true, - settings: { address: "", imageQuality: 0.2, theme: "system" }, + settings: { + address: "", + imageQuality: 0.2, + theme: "system", + defaultBookmarkView: "reader", + }, }, setSettings: async (settings) => { await SecureStore.setItemAsync(SETTING_NAME, JSON.stringify(settings)); |
