From d8f488e28c7d2eb0cf84611ea2ea9c26ed57cb1f Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 4 Sep 2020 17:54:34 -0400 Subject: Settings dictionary import refactor (#759) * Fix .purge not re-opening the database after deletion failure * Create DictionaryImportController * Remove backend dictionary import --- ext/bg/js/dictionary-database.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ext/bg/js/dictionary-database.js') 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) { -- cgit v1.2.3