aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/dictionary-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-03-02 20:27:51 -0500
committerGitHub <noreply@github.com>2021-03-02 20:27:51 -0500
commit4208595293a18c2cd95064caf77db786c2902ac8 (patch)
treebff87aa2eb501ad5cd11bdf70b2048edb662ffa2 /ext/js/pages/settings/dictionary-controller.js
parent571b865ae5207acb8e58a5ee38e4ed900194f7fb (diff)
Persistent storage controller (#1478)
* Add PersistentStorageController * Update DictionaryController * Update DictionaryImportController * Update when storage stats are updated
Diffstat (limited to 'ext/js/pages/settings/dictionary-controller.js')
-rw-r--r--ext/js/pages/settings/dictionary-controller.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js
index e12017f2..17abfa13 100644
--- a/ext/js/pages/settings/dictionary-controller.js
+++ b/ext/js/pages/settings/dictionary-controller.js
@@ -190,10 +190,9 @@ class DictionaryEntry {
}
class DictionaryController {
- constructor(settingsController, modalController, storageController, statusFooter) {
+ constructor(settingsController, modalController, statusFooter) {
this._settingsController = settingsController;
this._modalController = modalController;
- this._storageController = storageController;
this._statusFooter = statusFooter;
this._dictionaries = null;
this._dictionaryEntries = [];
@@ -436,7 +435,6 @@ class DictionaryController {
const index = this._dictionaryEntries.findIndex((entry) => entry.dictionaryTitle === dictionaryTitle);
if (index < 0) { return; }
- const storageController = this._storageController;
const statusFooter = this._statusFooter;
const {node} = this._dictionaryEntries[index];
const progressSelector = '.dictionary-delete-progress';
@@ -483,7 +481,7 @@ class DictionaryController {
if (statusFooter !== null) { statusFooter.setTaskActive(progressSelector, false); }
this._setButtonsEnabled(true);
this._isDeleting = false;
- if (storageController !== null) { storageController.updateStats(); }
+ this._triggerStorageChanged();
}
}
@@ -547,6 +545,10 @@ class DictionaryController {
}
}
+ _triggerStorageChanged() {
+ yomichan.trigger('storageChanged');
+ }
+
static createDefaultDictionarySettings() {
return {
enabled: false,