summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-19 17:17:33 -0400
committerGitHub <noreply@github.com>2020-09-19 17:17:33 -0400
commita2e6de84af6a304cf586759fe8a0d50d4d94785e (patch)
treebac23d15f0f048510b1cd67cd0331f4ffde15456 /ext/bg/js/backend.js
parent1078ab99b7a9d082ee36cbed69c8cb154db318b6 (diff)
Dictionary delete improvements (#844)
* Change where clearDatabaseCaches occurs * Move dictionary deletion into the settings page * Remove api.deleteDictionary
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 54982098..f656adbd 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -118,7 +118,6 @@ class Backend {
['triggerDatabaseUpdated', {async: false, contentScript: true, handler: this._onApiTriggerDatabaseUpdated.bind(this)}]
]);
this._messageHandlersWithProgress = new Map([
- ['deleteDictionary', {async: true, contentScript: false, handler: this._onApiDeleteDictionary.bind(this)}]
]);
this._commandHandlers = new Map([
@@ -700,7 +699,6 @@ class Backend {
}
async _onApiPurgeDatabase() {
- this._translator.clearDatabaseCaches();
await this._dictionaryDatabase.purge();
this._triggerDatabaseUpdated('dictionary', 'purge');
}
@@ -742,12 +740,6 @@ class Backend {
return details;
}
- async _onApiDeleteDictionary({dictionaryName}, sender, onProgress) {
- this._translator.clearDatabaseCaches();
- await this._dictionaryDatabase.deleteDictionary(dictionaryName, {rate: 1000}, onProgress);
- this._triggerDatabaseUpdated('dictionary', 'delete');
- }
-
async _onApiModifySettings({targets, source}) {
const results = [];
for (const target of targets) {
@@ -1721,6 +1713,7 @@ class Backend {
}
_triggerDatabaseUpdated(type, cause) {
+ this._translator.clearDatabaseCaches();
this._sendMessageAllTabs('databaseUpdated', {type, cause});
}