20 lines
427 B
TypeScript
20 lines
427 B
TypeScript
/* Shared open state for the settings popup (SettingsModal.vue).
|
|
The sidebar cog flips this flag; the modal itself owns the settings. */
|
|
export function useSettings() {
|
|
const open = useState<boolean>('settings:open', () => false)
|
|
|
|
function show() {
|
|
open.value = true
|
|
}
|
|
|
|
function hide() {
|
|
open.value = false
|
|
}
|
|
|
|
function toggle() {
|
|
open.value = !open.value
|
|
}
|
|
|
|
return { open, show, hide, toggle }
|
|
}
|