fix: remove unused code (#148)

This commit is contained in:
Nolan Lawson 2021-06-26 16:23:50 -07:00 committed by GitHub
parent fd3e0f3dfb
commit 304a18d2f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 11 deletions

View File

@ -129,7 +129,6 @@ export default class Database {
try {
await this._lazyUpdate // allow any lazy updates to process before closing/deleting
} catch (err) { /* ignore network errors (offline-first) */ }
return !!this._db // return true if we need to actually run the close/delete logic
}
// clear references to IDB, e.g. during a close event
@ -143,18 +142,12 @@ export default class Database {
}
async close () {
// TODO: this else never gets hit in tests
/* istanbul ignore else */
if (await this._shutdown()) {
await closeDatabase(this._dbName)
}
await this._shutdown()
await closeDatabase(this._dbName)
}
async delete () {
// TODO: this else never gets hit in tests
/* istanbul ignore else */
if (await this._shutdown()) {
await deleteDatabase(this._dbName)
}
await this._shutdown()
await deleteDatabase(this._dbName)
}
}