Ensure database is only closed if it is open in closeDb function
This commit is contained in:
@@ -475,7 +475,9 @@ export function flushPendingSave() {
|
|||||||
*/
|
*/
|
||||||
export function closeDb() {
|
export function closeDb() {
|
||||||
flushPendingSave();
|
flushPendingSave();
|
||||||
db.close();
|
if (db.open) {
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default db;
|
export default db;
|
||||||
|
|||||||
Reference in New Issue
Block a user