Skip to content

Commit e0067c3

Browse files
committed
log indexedb block event
1 parent 28f7389 commit e0067c3

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@
8181
},
8282
{
8383
"path": "./build/releases/OneSignalSDK.page.es6.js",
84-
"limit": "55.07 kB",
84+
"limit": "55.08 kB",
8585
"gzip": true
8686
},
8787
{
8888
"path": "./build/releases/OneSignalSDK.sw.js",
89-
"limit": "15.41 kB",
89+
"limit": "15.42 kB",
9090
"gzip": true
9191
},
9292
{

src/shared/database/client.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { openDB, type StoreNames } from 'idb';
2+
import Log from '../libraries/Log';
23
import { ONESIGNAL_SESSION_KEY } from '../session/constants';
34
import { IS_SERVICE_WORKER } from '../utils/EnvVariables';
45
import {
@@ -20,7 +21,7 @@ let dbInstance: Awaited<ReturnType<typeof openDB<IndexedDBSchema>>> | null =
2021
export const getDb = async (version = VERSION) => {
2122
if (dbInstance) return dbInstance;
2223
dbInstance = await openDB<IndexedDBSchema>(DATABASE_NAME, version, {
23-
async upgrade(_db, oldVersion, newVersion, transaction) {
24+
upgrade(_db, oldVersion, newVersion, transaction) {
2425
const newDbVersion = newVersion || version;
2526
if (newDbVersion >= 1 && oldVersion < 1) {
2627
_db.createObjectStore('Ids', { keyPath: 'type' });
@@ -80,6 +81,9 @@ export const getDb = async (version = VERSION) => {
8081
OneSignal._isNewVisitor = true;
8182
}
8283
},
84+
blocked() {
85+
Log.debug('IndexedDB: Blocked event');
86+
},
8387
});
8488
return dbInstance;
8589
};

0 commit comments

Comments
 (0)