This commit is contained in:
Nolan Lawson 2020-05-08 16:24:58 -07:00
parent bfa7c1af14
commit 364d757666
2 changed files with 8 additions and 4 deletions

View File

@ -75,7 +75,8 @@ export class IndexedDBEngine {
})
}
close () {
return closeDatabase(DB_NAME)
async close () {
await closeDatabase(DB_NAME)
this._db = null
}
}

View File

@ -50,6 +50,9 @@ export async function getEmojiByUnicode (unicode) {
}
export async function closeDatabase () {
await init()
return idbEngine.close()
if (idbEngine) {
await idbEngine.readyPromise
await idbEngine.close()
idbEngine = undefined
}
}