feat: persist listen mode across views via localStorage
Extract listen mode into a shared useListenMode() composable backed by
localStorage ('fa_listen_mode'). ChatView and BriefingView both use it,
so toggling auto-read on in one view keeps it on after navigation or
page refresh — no need to re-enable it each visit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
const LISTEN_MODE_KEY = 'fa_listen_mode'
|
||||
|
||||
// Shared across all views — persisted to localStorage
|
||||
const _listenMode = ref<boolean>(localStorage.getItem(LISTEN_MODE_KEY) === 'true')
|
||||
|
||||
watch(_listenMode, (v) => {
|
||||
localStorage.setItem(LISTEN_MODE_KEY, String(v))
|
||||
})
|
||||
|
||||
export function useListenMode() {
|
||||
return _listenMode
|
||||
}
|
||||
Reference in New Issue
Block a user