2
0

Remember result in either local or session storage (#514)

Closes #513
This commit is contained in:
Baptiste Arnaud
2023-05-16 14:58:56 +02:00
committed by GitHub
parent 0ae2a4ba8b
commit 27b009dd76
11 changed files with 129 additions and 50 deletions

View File

@ -1,11 +1,19 @@
import { z } from 'zod'
export const rememberUserStorages = ['session', 'local'] as const
const generalSettings = z.object({
isBrandingEnabled: z.boolean(),
isTypingEmulationEnabled: z.boolean().optional(),
isInputPrefillEnabled: z.boolean().optional(),
isHideQueryParamsEnabled: z.boolean().optional(),
isNewResultOnRefreshEnabled: z.boolean().optional(),
rememberUser: z
.object({
isEnabled: z.boolean().optional(),
storage: z.enum(rememberUserStorages).optional(),
})
.optional(),
})
const typingEmulation = z.object({
@ -32,7 +40,9 @@ export const settingsSchema = z.object({
export const defaultSettings: Settings = {
general: {
isBrandingEnabled: true,
isNewResultOnRefreshEnabled: true,
rememberUser: {
isEnabled: false,
},
isInputPrefillEnabled: true,
isHideQueryParamsEnabled: true,
},