diff options
Diffstat (limited to 'ext/js/pages/settings')
-rw-r--r-- | ext/js/pages/settings/backup-controller.js | 10 | ||||
-rw-r--r-- | ext/js/pages/settings/dictionary-import-controller.js | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js index 5c168849..f0876d3f 100644 --- a/ext/js/pages/settings/backup-controller.js +++ b/ext/js/pages/settings/backup-controller.js @@ -574,12 +574,16 @@ export class BackupController { * @returns {Promise<Blob>} */ async _exportDatabase(databaseName) { - const db = await new Dexie(databaseName).open(); + const DexieConstructor = /** @type {import('dexie').DexieConstructor} */ (/** @type {unknown} */ (Dexie)); + const db = new DexieConstructor(databaseName); + await db.open(); + /** @type {unknown} */ + // @ts-expect-error - The export function is declared as an extension which has no type information. const blob = await db.export({ progressCallback: this._databaseExportProgressCallback.bind(this) }); - await db.close(); - return blob; + db.close(); + return /** @type {Blob} */ (blob); } /** */ diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index f63eb49e..ecfadc1f 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -306,6 +306,7 @@ export class DictionaryImportController { * @param {Error[]} errors */ _showErrors(errors) { + /** @type {Map<string, number>} */ const uniqueErrors = new Map(); for (const error of errors) { log.error(error); |