Browse Source

remove db.close calls that caused an error when trying to download

pull/101/head
Trent Larson 11 months ago
parent
commit
7a099183ae
  1. 10
      src/views/AccountViewView.vue

10
src/views/AccountViewView.vue

@ -506,7 +506,6 @@ export default class AccountViewView extends Vue {
const account: { identity?: string } | undefined = const account: { identity?: string } | undefined =
await accountsDB.accounts.where("did").equals(activeDid).first(); await accountsDB.accounts.where("did").equals(activeDid).first();
accountsDB.close();
// Return parsed identity or null if not found // Return parsed identity or null if not found
return JSON.parse((account?.identity as string) || "null"); return JSON.parse((account?.identity as string) || "null");
} catch (error) { } catch (error) {
@ -561,7 +560,6 @@ export default class AccountViewView extends Vue {
async beforeCreate() { async beforeCreate() {
await accountsDB.open(); await accountsDB.open();
this.numAccounts = await accountsDB.accounts.count(); this.numAccounts = await accountsDB.accounts.count();
accountsDB.close();
} }
/** /**
@ -586,7 +584,6 @@ export default class AccountViewView extends Vue {
if (identity) { if (identity) {
this.processIdentity(identity); this.processIdentity(identity);
} }
db.close();
} catch (err: unknown) { } catch (err: unknown) {
this.handleError(err); this.handleError(err);
} }
@ -683,7 +680,6 @@ export default class AccountViewView extends Vue {
db.settings.update(MASTER_SETTINGS_KEY, { db.settings.update(MASTER_SETTINGS_KEY, {
showContactGivesInline: this.showContactGives, showContactGivesInline: this.showContactGives,
}); });
db.close();
} catch (err) { } catch (err) {
this.$notify( this.$notify(
{ {
@ -868,7 +864,6 @@ export default class AccountViewView extends Vue {
isRegistered: true, isRegistered: true,
}); });
this.isRegistered = true; this.isRegistered = true;
db.close();
} catch (err) { } catch (err) {
console.error("Got an error updating settings:", err); console.error("Got an error updating settings:", err);
this.$notify( this.$notify(
@ -940,7 +935,6 @@ export default class AccountViewView extends Vue {
} else { } else {
await this.switchToAccountNumber(accountNum); await this.switchToAccountNumber(accountNum);
} }
db.close();
} }
/** /**
@ -975,8 +969,6 @@ export default class AccountViewView extends Vue {
await db.settings.update(MASTER_SETTINGS_KEY, { activeDid: account.did }); await db.settings.update(MASTER_SETTINGS_KEY, { activeDid: account.did });
this.updateActiveAccountProperties(account); this.updateActiveAccountProperties(account);
db.close();
accountsDB.close();
} }
/** /**
@ -1004,7 +996,6 @@ export default class AccountViewView extends Vue {
apiServer: this.apiServerInput, apiServer: this.apiServerInput,
}); });
this.apiServer = this.apiServerInput; this.apiServer = this.apiServerInput;
db.close();
} }
async onClickSavePushServer() { async onClickSavePushServer() {
@ -1022,7 +1013,6 @@ export default class AccountViewView extends Vue {
}, },
-1, -1,
); );
db.close();
} }
} }
</script> </script>

Loading…
Cancel
Save