Fix database worker for when indexeddb is disabled

This commit is contained in:
Mitchell McCaffrey 2020-11-26 17:08:09 +11:00
parent 7ac555baa0
commit 025304ee44

View File

@ -6,10 +6,12 @@ import { getDatabase } from "../database";
let obj = {
data: [],
async loadData(table) {
let db = getDatabase({});
this.data = [];
// Use a cursor instead of toArray to prevent IPC max size error
await db.table(table).each((map) => this.data.push(map));
try {
let db = getDatabase({});
// Use a cursor instead of toArray to prevent IPC max size error
await db.table(table).each((map) => this.data.push(map));
} catch {}
},
};