summaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary-database.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-04 17:54:34 -0400
committerGitHub <noreply@github.com>2020-09-04 17:54:34 -0400
commitd8f488e28c7d2eb0cf84611ea2ea9c26ed57cb1f (patch)
treef7f121c9bfa384375d84a5fe4014f782d8421ea2 /ext/bg/js/dictionary-database.js
parent8cd5a2f75f192417eee49f221029d50d77aef82d (diff)
Settings dictionary import refactor (#759)
* Fix .purge not re-opening the database after deletion failure * Create DictionaryImportController * Remove backend dictionary import
Diffstat (limited to 'ext/bg/js/dictionary-database.js')
-rw-r--r--ext/bg/js/dictionary-database.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/bg/js/dictionary-database.js b/ext/bg/js/dictionary-database.js
index c6798fb3..55fc0915 100644
--- a/ext/bg/js/dictionary-database.js
+++ b/ext/bg/js/dictionary-database.js
@@ -117,8 +117,15 @@ class DictionaryDatabase {
if (this._db.isOpen()) {
this._db.close();
}
- await Database.deleteDatabase(this._dbName);
+ let result = false;
+ try {
+ await Database.deleteDatabase(this._dbName);
+ result = true;
+ } catch (e) {
+ yomichan.logError(e);
+ }
await this.prepare();
+ return result;
}
async deleteDictionary(dictionaryName, progressSettings, onProgress) {