fix errors

This commit is contained in:
ilya-bkv 2023-11-13 16:44:04 +03:00
parent b83005fbaa
commit d65d9c4188

View File

@ -47,8 +47,8 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => {
const [db, setDb] = createSignal<Promise<IDBPDatabase<unknown>>>() const [db, setDb] = createSignal<Promise<IDBPDatabase<unknown>>>()
onMount(() => { onMount(() => {
const dbx = openDB('notifications-db', 1, { const dbx = openDB('notifications-db', 1, {
upgrade(db) { upgrade(indexedDb) {
db.createObjectStore('notifications') indexedDb.createObjectStore('notifications')
} }
}) })
setDb(dbx) setDb(dbx)
@ -121,7 +121,7 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => {
}, },
onerror(err) { onerror(err) {
console.error('[context.notifications] sse connection closed by error', err) console.error('[context.notifications] sse connection closed by error', err)
throw new Error() // NOTE: simple hack to close the connection throw new Error(err) // NOTE: simple hack to close the connection
} }
}) })
} }