refactor(desktop): trim backdrop store to match tool-view style
parent
1813d3046c
commit
bccc827dbf
|
|
@ -1,21 +1,14 @@
|
||||||
/**
|
|
||||||
* Chat backdrop image (the faint statue behind the transcript). One boolean,
|
|
||||||
* on by default. Purely presentational renderer state — the `Backdrop`
|
|
||||||
* component just skips rendering when it's off.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { atom } from 'nanostores'
|
import { atom } from 'nanostores'
|
||||||
|
|
||||||
import { persistBoolean, storedBoolean } from '@/lib/storage'
|
import { persistBoolean, storedBoolean } from '@/lib/storage'
|
||||||
|
|
||||||
const KEY = 'hermes.desktop.backdrop.v1'
|
const KEY = 'hermes.desktop.backdrop.v1'
|
||||||
|
|
||||||
export const $backdrop = atom<boolean>(typeof window === 'undefined' ? true : storedBoolean(KEY, true))
|
/** Whether the faint statue image renders behind the chat transcript. */
|
||||||
|
export const $backdrop = atom(storedBoolean(KEY, true))
|
||||||
|
|
||||||
export function setBackdrop(on: boolean): void {
|
$backdrop.subscribe(on => persistBoolean(KEY, on))
|
||||||
|
|
||||||
|
export function setBackdrop(on: boolean) {
|
||||||
$backdrop.set(on)
|
$backdrop.set(on)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
$backdrop.subscribe(on => persistBoolean(KEY, on))
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue