fix(core): update

This commit is contained in:
2023-05-01 12:44:59 +02:00
parent 257b995ca0
commit 6f425906e5
5 changed files with 257 additions and 2 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/webstore',
version: '2.0.6',
version: '2.0.7',
description: 'high performance storage in the browser using indexed db'
}

View File

@ -24,8 +24,14 @@ export class WebStore<T = any> {
this.initCalled = true;
const smartenv = new plugins.smartenv.Smartenv();
if (!smartenv.isBrowser) {
if (!smartenv.isBrowser && !globalThis.indexedDB) {
console.log('hey');
console.log(globalThis.indexedDB);
await smartenv.getSafeNodeModule('fake-indexeddb/auto');
if (!globalThis.indexedDB) {
const mod = await smartenv.getSafeNodeModule('fake-indexeddb');
globalThis.indexedDB = new mod.IDBFactory();
}
}
this.db = await plugins.idb.openDB(this.options.dbName, 1, {