bug fixes galore

This commit is contained in:
FTCHD
2026-05-10 22:37:26 +03:00
parent d749844073
commit c1516bda65
28 changed files with 199 additions and 238 deletions
+3 -3
View File
@@ -34,9 +34,9 @@ export async function initHostStore(hostId: string) {
}
try {
disposeKeyChange = activeStore.onKeyChange('host-store', async () => {
disposeKeyChange = await activeStore.onKeyChange('host-store', async () => {
await useHostStore.persist.rehydrate()
}) as unknown as () => void
})
} catch (err) {
console.error('[HostStore] failed to register onKeyChange listener', err)
}
@@ -49,7 +49,7 @@ const getStorage = (): StateStorage => ({
getItem: async (name: string): Promise<string | null> => {
if (!activeStore) return null
// console.log('[HostStore] getItem', { name, host: activeHostId })
return (await activeStore.get(name)) || null
return (await activeStore.get(name)) ?? null
},
setItem: async (name: string, value: string): Promise<void> => {
if (!activeStore) return
+1 -1
View File
@@ -142,7 +142,7 @@ interface PersistedStateV2 {
const getStorage = (store: LazyStore): StateStorage => ({
getItem: async (name: string): Promise<string | null> => {
console.log('getItem', { name })
return (await store.get(name)) || null
return (await store.get(name)) ?? null
},
setItem: async (name: string, value: string): Promise<void> => {
console.log('setItem', { name, value })