Skip to content

Chat · Search params & storage

9 modules · 32 exports · 1 repository · 16 e2e tests · 5 routes

The state Chat keeps in the URL and in the browser's storage. Every param has a default and never fails to decode, see Search params, and each definition should have an assertRoundTrips test. The definitions of the whole app are listed in the reference.

Search params

URL chatSearchParams

app/features/chat/chat-search-params.ts:5

ParamValueDefaultLoaderDescription
chat v.nullable(v.pipe(v.number(), v.integer(), v.minValue(1)))nullfalse

Used in ChatProvider.tsxchat-urls.ts

Web storage

localStorage soundEnabledPersisted

app/features/chat/chat-persisted.ts:5

Sound code -> whether the sound plays

Key prefixsettings__sound-enabled__
Valuev.boolean()
Defaulttrue

Used in Sounds.tsSoundsTab.tsx

localStorage soundVolumePersisted

app/features/chat/chat-persisted.ts:13

Volume of every sound, 0-100

Keysettings__sound-volume
Valuev.pipe(v.number(), v.minValue(0), v.maxValue(100))
Default100

Used in Sounds.tsSoundsTab.tsx

localStorage cooldownsPersisted

app/features/chat/chat-persisted.ts:21

Cooldown key -> timestamp (ms) the cooldown ends, shared between tabs

Keychat__cooldowns
Valuev.record(v.string(), v.number())
Default{}

Used in Cooldowns.ts

localStorage lastActiveTabPersisted

app/features/chat/chat-persisted.ts:29

Id of the tab the user last paid attention to, null before any

Keychat__last-active-tab
Valuev.nullable(v.string())
Defaultnull

Used in Attention.ts