More cleanup and application of new db loading

This commit is contained in:
Matthew Raymer
2023-07-08 18:31:12 +08:00
parent 3471afdf25
commit 3bd55f3ad2
6 changed files with 83 additions and 44 deletions

View File

@@ -142,11 +142,21 @@ export default class ContactsView extends Vue {
giveRecords: Array<GiveServerRecord> = [];
alertTitle = "";
alertMessage = "";
accounts: AccountsSchema;
numAccounts = 0;
async beforeCreate() {
accountsDB.open();
this.accounts = accountsDB.accounts;
this.numAccounts = await this.accounts.count();
}
public async getIdentity(activeDid) {
await accountsDB.open();
const accounts = await accountsDB.accounts.toArray();
const account = R.find((acc) => acc.did === activeDid, accounts);
const account = await accountsDB.accounts
.where("did")
.equals(activeDid)
.first();
const identity = JSON.parse(account?.identity || "null");
if (!identity) {