diff --git a/src/components/AlertMessage.vue b/src/components/AlertMessage.vue index 9e8666ef4..f425e66d0 100644 --- a/src/components/AlertMessage.vue +++ b/src/components/AlertMessage.vue @@ -1,14 +1,14 @@ diff --git a/src/views/ContactAmountsView.vue b/src/views/ContactAmountsView.vue index b05099f08..1b1b46fb1 100644 --- a/src/views/ContactAmountsView.vue +++ b/src/views/ContactAmountsView.vue @@ -150,16 +150,23 @@ export default class ContactsView extends Vue { // 'created' hook runs when the Vue instance is first created async created() { - await db.open(); - const contactDid = this.$route.query.contactDid as string; - this.contact = (await db.contacts.get(contactDid)) || null; + try { + await db.open(); + const contactDid = this.$route.query.contactDid as string; + this.contact = (await db.contacts.get(contactDid)) || null; - const settings = await db.settings.get(MASTER_SETTINGS_KEY); - this.activeDid = settings?.activeDid || ""; - this.apiServer = settings?.apiServer || ""; + const settings = await db.settings.get(MASTER_SETTINGS_KEY); + this.activeDid = settings?.activeDid || ""; + this.apiServer = settings?.apiServer || ""; - if (this.activeDid && this.contact) { - this.loadGives(this.activeDid, this.contact); + if (this.activeDid && this.contact) { + this.loadGives(this.activeDid, this.contact); + } + } catch (err) { + this.alertTitle = "Error"; + this.alertMessage = + err.userMessage || + "There was an error retrieving the latest sweet, sweet action."; } }