forked from trent_larson/crowd-funder-for-time-pwa
Added try...catch and linted
This commit is contained in:
@@ -40,7 +40,6 @@ export default class AlertMessage extends Vue {
|
|||||||
"duration-300": true,
|
"duration-300": true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ export default class ContactsView extends Vue {
|
|||||||
|
|
||||||
// 'created' hook runs when the Vue instance is first created
|
// 'created' hook runs when the Vue instance is first created
|
||||||
async created() {
|
async created() {
|
||||||
|
try {
|
||||||
await db.open();
|
await db.open();
|
||||||
const contactDid = this.$route.query.contactDid as string;
|
const contactDid = this.$route.query.contactDid as string;
|
||||||
this.contact = (await db.contacts.get(contactDid)) || null;
|
this.contact = (await db.contacts.get(contactDid)) || null;
|
||||||
@@ -161,6 +162,12 @@ export default class ContactsView extends Vue {
|
|||||||
if (this.activeDid && this.contact) {
|
if (this.activeDid && this.contact) {
|
||||||
this.loadGives(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.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadGives(activeDid: string, contact: Contact) {
|
async loadGives(activeDid: string, contact: Contact) {
|
||||||
|
|||||||
Reference in New Issue
Block a user