mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
fix(client): make display settings refs singletons for live updates
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { ref, watch } from 'vue'
|
||||
import { storage } from '@/services/storage'
|
||||
|
||||
const coverSize = ref(storage.get('coverSize', 150))
|
||||
const gridGap = ref(storage.get('gridGap', 16))
|
||||
const viewMode = ref<'grid' | 'list'>(storage.get('viewMode', 'grid'))
|
||||
|
||||
watch(coverSize, (v) => storage.set('coverSize', v))
|
||||
watch(gridGap, (v) => storage.set('gridGap', v))
|
||||
watch(viewMode, (v) => storage.set('viewMode', v))
|
||||
|
||||
export function useDisplaySettings() {
|
||||
const coverSize = ref(storage.get('coverSize', 150))
|
||||
const gridGap = ref(storage.get('gridGap', 16))
|
||||
const viewMode = ref<'grid' | 'list'>(storage.get('viewMode', 'grid'))
|
||||
|
||||
watch(coverSize, (v) => storage.set('coverSize', v))
|
||||
watch(gridGap, (v) => storage.set('gridGap', v))
|
||||
watch(viewMode, (v) => storage.set('viewMode', v))
|
||||
|
||||
return { coverSize, gridGap, viewMode }
|
||||
}
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "7",
|
||||
"when": 1768909427779,
|
||||
"when": 1769077922285,
|
||||
"tag": "0000_baseline",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "7",
|
||||
"when": 1768909427779,
|
||||
"when": 1769077922285,
|
||||
"tag": "0001_add_scan_jobs_cascade",
|
||||
"breakpoints": true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user