forked from jsnbuchanan/crowd-funder-for-time-pwa
Move account counter to mounted event
This commit is contained in:
@@ -315,6 +315,7 @@ export default class AccountViewView extends Vue {
|
|||||||
limitsMessage = "";
|
limitsMessage = "";
|
||||||
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message
|
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message
|
||||||
showContactGives = false;
|
showContactGives = false;
|
||||||
|
private accounts: AccountsSchema;
|
||||||
|
|
||||||
showDidCopy = false;
|
showDidCopy = false;
|
||||||
showDerCopy = false;
|
showDerCopy = false;
|
||||||
@@ -361,7 +362,16 @@ export default class AccountViewView extends Vue {
|
|||||||
return timeStr.substring(0, timeStr.indexOf("T"));
|
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() {
|
async created() {
|
||||||
// Uncomment this to register this user on the test server.
|
// Uncomment this to register this user on the test server.
|
||||||
// To manage within the vue devtools browser extension https://devtools.vuejs.org/
|
// 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;
|
this.showContactGives = !!settings?.showContactGivesInline;
|
||||||
|
|
||||||
const identity = await this.getIdentity(this.activeDid);
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
|
|
||||||
this.publicHex = identity.keys[0].publicKeyHex;
|
this.publicHex = identity.keys[0].publicKeyHex;
|
||||||
this.publicBase64 = Buffer.from(this.publicHex, "hex").toString("base64");
|
this.publicBase64 = Buffer.from(this.publicHex, "hex").toString("base64");
|
||||||
this.derivationPath = identity.keys[0].meta.derivationPath;
|
this.derivationPath = identity.keys[0].meta.derivationPath;
|
||||||
|
|||||||
Reference in New Issue
Block a user