bug fixes galore
This commit is contained in:
+3
-3
@@ -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
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user