From 5961c3b279dd5ef8d3597579843b56d6f2aa09c1 Mon Sep 17 00:00:00 2001 From: Darius Jahandarie Date: Sun, 29 Dec 2024 12:31:38 +0900 Subject: [PATCH] Fix broken dictionary collection import (#1718) * fix broken dictionary collection import * fix tests --- ext/js/dictionary/dictionary-database.js | 4 ++++ test/utilities/database.js | 1 + 2 files changed, 5 insertions(+) diff --git a/ext/js/dictionary/dictionary-database.js b/ext/js/dictionary/dictionary-database.js index b899c1be3..2212279e9 100644 --- a/ext/js/dictionary/dictionary-database.js +++ b/ext/js/dictionary/dictionary-database.js @@ -200,6 +200,10 @@ export class DictionaryDatabase { if (this._db.isOpen()) { this._db.close(); } + if (this._worker !== null) { + this._worker.terminate(); + this._worker = null; + } let result = false; try { await Database.deleteDatabase(this._dbName); diff --git a/test/utilities/database.js b/test/utilities/database.js index 4fdf93ad0..abc749314 100644 --- a/test/utilities/database.js +++ b/test/utilities/database.js @@ -30,6 +30,7 @@ export function setupStubs() { function Worker() { return { addEventListener: () => {}, + terminate: () => {}, }; } vi.stubGlobal('Worker', Worker);