From 99ea161da01e123da772992c4be8ac931e106c36 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Mon, 3 Jul 2023 18:48:01 +0800 Subject: [PATCH] Removed created() and relocated to mounted() could not replicate issue --- src/views/HomeView.vue | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 3056d921d..f9af6e156 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -148,25 +148,17 @@ export default class HomeView extends Vue { // 'created' hook runs when the Vue instance is first created async created() { - await accountsDB.open(); - this.allAccounts = await accountsDB.accounts.toArray(); - await db.open(); - const settings = await db.settings.get(MASTER_SETTINGS_KEY); - this.activeDid = settings?.activeDid || ""; - this.allContacts = await db.contacts.toArray(); - this.feedLastViewedId = settings?.lastViewedClaimId; - } - - // 'mounted' hook runs after initial render - async mounted() { try { + await accountsDB.open(); + this.allAccounts = await accountsDB.accounts.toArray(); await db.open(); const settings = await db.settings.get(MASTER_SETTINGS_KEY); this.apiServer = settings?.apiServer || ""; - + this.activeDid = settings?.activeDid || ""; + this.allContacts = await db.contacts.toArray(); + this.feedLastViewedId = settings?.lastViewedClaimId; this.updateAllFeed(); } catch (err) { - console.log("Error in mounted():", err); this.alertTitle = "Error"; this.alertMessage = err.userMessage || @@ -217,7 +209,6 @@ export default class HomeView extends Vue { (acc) => acc.did === this.activeDid, this.allAccounts ); - //console.log("about to parse from", this.activeDid, account?.identity); const identity = JSON.parse(account?.identity || "null"); if (!identity) { throw new Error("No identity found.");