Browse Source

Move account counter to mounted event

kb/add-usage-guide
Matthew Raymer 1 year ago
parent
commit
e25a83ff1b
  1. 13
      src/views/AccountViewView.vue

13
src/views/AccountViewView.vue

@ -315,6 +315,7 @@ export default class AccountViewView extends Vue {
limitsMessage = "";
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message
showContactGives = false;
private accounts: AccountsSchema;
showDidCopy = false;
showDerCopy = false;
@ -361,7 +362,16 @@ export default class AccountViewView extends Vue {
return timeStr.substring(0, timeStr.indexOf("T"));
}
// 'created' hook runs when the Vue instance is first created
async initializeCount() {
this.numAccounts = await this.accounts.count();
}
async mounted() {
accountsDB.open();
this.accounts = accountsDB.accounts;
await this.initializeCount();
}
async created() {
// Uncomment this to register this user on the test server.
// To manage within the vue devtools browser extension https://devtools.vuejs.org/
@ -380,6 +390,7 @@ export default class AccountViewView extends Vue {
this.showContactGives = !!settings?.showContactGivesInline;
const identity = await this.getIdentity(this.activeDid);
this.publicHex = identity.keys[0].publicKeyHex;
this.publicBase64 = Buffer.from(this.publicHex, "hex").toString("base64");
this.derivationPath = identity.keys[0].meta.derivationPath;

Loading…
Cancel
Save