Skip to content

Commit

Permalink
fix: remove unused code (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Jun 26, 2021
1 parent fd3e0f3 commit 304a18d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/database/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
}

0 comments on commit 304a18d

Please sign in to comment.