diff options
Diffstat (limited to 'ext/js/pages/settings/backup-controller.js')
-rw-r--r-- | ext/js/pages/settings/backup-controller.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js index 79733c4d..59bcaed9 100644 --- a/ext/js/pages/settings/backup-controller.js +++ b/ext/js/pages/settings/backup-controller.js @@ -579,7 +579,9 @@ export class BackupController { */ async _exportDatabase(databaseName) { const db = await new Dexie(databaseName).open(); - const blob = await db.export({progressCallback: this._databaseExportProgressCallback}); + const blob = await db.export({ + progressCallback: this._databaseExportProgressCallback.bind(this) + }); await db.close(); return blob; } @@ -639,12 +641,14 @@ export class BackupController { } /** - * @param {string} databaseName + * @param {string} _databaseName * @param {File} file */ - async _importDatabase(databaseName, file) { + async _importDatabase(_databaseName, file) { await this._settingsController.application.api.purgeDatabase(); - await Dexie.import(file, {progressCallback: this._databaseImportProgressCallback}); + await Dexie.import(file, { + progressCallback: this._databaseImportProgressCallback.bind(this) + }); this._settingsController.application.api.triggerDatabaseUpdated('dictionary', 'import'); this._settingsController.application.triggerStorageChanged(); } |