Added error banner to database and updated to custom dexie-export-import build

This commit is contained in:
Mitchell McCaffrey
2021-02-13 13:21:13 +11:00
parent 93f45c738f
commit 405e6ed6a3
4 changed files with 61 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
import * as Comlink from "comlink";
import { importDB, exportDB } from "dexie-export-import";
import { importInto, exportDB } from "@mitchemmc/dexie-export-import";
import { encode } from "@msgpack/msgpack";
import { getDatabase } from "../database";
@@ -43,13 +43,11 @@ let service = {
* @param {function} progressCallback
*/
async exportData(progressCallback) {
try {
let db = getDatabase({});
return await exportDB(db, {
progressCallback,
numRowsPerChunk: 1,
});
} catch {}
let db = getDatabase({});
return await exportDB(db, {
progressCallback,
numRowsPerChunk: 1,
});
},
/**
@@ -58,9 +56,8 @@ let service = {
* @param {function} progressCallback
*/
async importData(data, progressCallback) {
try {
await importDB(data, { progressCallback });
} catch {}
let db = getDatabase({});
await importInto(db, data, { progressCallback, overwriteValues: true });
},
};