diff options
Diffstat (limited to 'ext/js/pages/settings')
-rw-r--r-- | ext/js/pages/settings/backup-controller.js | 12 | ||||
-rw-r--r-- | ext/js/pages/settings/profile-controller.js | 3 |
2 files changed, 10 insertions, 5 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(); } diff --git a/ext/js/pages/settings/profile-controller.js b/ext/js/pages/settings/profile-controller.js index c5ccbe7d..5a7b5ed4 100644 --- a/ext/js/pages/settings/profile-controller.js +++ b/ext/js/pages/settings/profile-controller.js @@ -549,7 +549,8 @@ export class ProfileController { Number.isFinite(intValue) && intValue >= 0 && intValue < this.profileCount ? - intValue : null + intValue : + null ); } |