aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/dictionary-import-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-13 12:32:43 -0500
committerGitHub <noreply@github.com>2020-12-13 12:32:43 -0500
commit14b9e0621b34d34411c1e3eec8ff1d89b6717756 (patch)
treeba61a325b45f1ced24b63a3e614ba41f5b032bcb /ext/bg/js/settings/dictionary-import-controller.js
parent5d2edda7534360def79921eb9d38ef72b4f6da04 (diff)
Updated welcome page (#1107)
* Make storage controller optional * Make more elements optional * Update styles * Create new welcome page * Update URL for welcome guide * Remove old guide * Fix unused global
Diffstat (limited to 'ext/bg/js/settings/dictionary-import-controller.js')
-rw-r--r--ext/bg/js/settings/dictionary-import-controller.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/bg/js/settings/dictionary-import-controller.js b/ext/bg/js/settings/dictionary-import-controller.js
index 15632d62..4945d54c 100644
--- a/ext/bg/js/settings/dictionary-import-controller.js
+++ b/ext/bg/js/settings/dictionary-import-controller.js
@@ -93,7 +93,7 @@ class DictionaryImportController {
if (this._modifying) { return; }
const purgeNotification = this._purgeNotification;
-
+ const storageController = this._storageController;
const prevention = this._preventPageExit();
try {
@@ -114,8 +114,8 @@ class DictionaryImportController {
prevention.end();
if (purgeNotification !== null) { purgeNotification.hidden = true; }
this._setSpinnerVisible(false);
- this._storageController.updateStats();
this._setModifying(false);
+ if (storageController !== null) { storageController.updateStats(); }
}
}
@@ -157,7 +157,7 @@ class DictionaryImportController {
const statusString = `${percent.toFixed(0)}%`;
for (const progressBar of progressBars) { progressBar.style.width = cssString; }
for (const label of statusLabels) { label.textContent = statusString; }
- storageController.updateStats();
+ if (storageController !== null) { storageController.updateStats(); }
};
const fileCount = files.length;
@@ -187,6 +187,7 @@ class DictionaryImportController {
}
this._setSpinnerVisible(false);
this._setModifying(false);
+ if (storageController !== null) { storageController.updateStats(); }
}
}