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
| Param | Value | Default | Loader | Description |
|---|---|---|---|---|
chat | v.nullable(v.pipe(v.number(), v.integer(), v.minValue(1))) | null | false |
Used in ChatProvider.tsxchat-urls.ts
Web storage
localStorage soundEnabledPersisted
app/features/chat/chat-persisted.ts:5
Sound code -> whether the sound plays
| Key prefix | settings__sound-enabled__ |
|---|---|
| Value | v.boolean() |
| Default | true |
Used in Sounds.tsSoundsTab.tsx
localStorage soundVolumePersisted
app/features/chat/chat-persisted.ts:13
Volume of every sound, 0-100
| Key | settings__sound-volume |
|---|---|
| Value | v.pipe(v.number(), v.minValue(0), v.maxValue(100)) |
| Default | 100 |
Used in Sounds.tsSoundsTab.tsx
localStorage cooldownsPersisted
app/features/chat/chat-persisted.ts:21
Cooldown key -> timestamp (ms) the cooldown ends, shared between tabs
| Key | chat__cooldowns |
|---|---|
| Value | v.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
| Key | chat__last-active-tab |
|---|---|
| Value | v.nullable(v.string()) |
| Default | null |
Used in Attention.ts