Files
hermes-agent/apps/desktop/src/store/haptics.ts
2026-05-01 16:44:30 -05:00

18 lines
494 B
TypeScript

import { atom } from 'nanostores'
import { persistBoolean, storedBoolean } from '@/lib/storage'
const HAPTICS_MUTED_STORAGE_KEY = 'hermes.desktop.hapticsMuted'
export const $hapticsMuted = atom(storedBoolean(HAPTICS_MUTED_STORAGE_KEY, false))
$hapticsMuted.subscribe(muted => persistBoolean(HAPTICS_MUTED_STORAGE_KEY, muted))
export function setHapticsMuted(muted: boolean) {
$hapticsMuted.set(muted)
}
export function toggleHapticsMuted() {
$hapticsMuted.set(!$hapticsMuted.get())
}