|
@ -284,6 +284,7 @@ export default class HomeView extends Vue { |
|
|
this.allContacts = await db.contacts.toArray(); |
|
|
this.allContacts = await db.contacts.toArray(); |
|
|
this.feedLastViewedId = settings?.lastViewedClaimId; |
|
|
this.feedLastViewedId = settings?.lastViewedClaimId; |
|
|
this.updateAllFeed(); |
|
|
this.updateAllFeed(); |
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
} catch (err: any) { |
|
|
} catch (err: any) { |
|
|
this.$notify( |
|
|
this.$notify( |
|
|
{ |
|
|
{ |
|
@ -384,12 +385,11 @@ export default class HomeView extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
giveDescription(giveRecord: GiveServerRecord) { |
|
|
giveDescription(giveRecord: GiveServerRecord) { |
|
|
let claim = giveRecord.fullClaim; |
|
|
// claim.claim happen for some claims wrapped in a Verifiable Credential |
|
|
if ((claim as any).claim) { |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
// can happen for some claims wrapped in a Verifiable Credential |
|
|
const claim = (giveRecord.fullClaim as any).claim || giveRecord.fullClaim; |
|
|
claim = (claim as any).claim; |
|
|
|
|
|
} |
|
|
|
|
|
// agent.did is for legacy data, before March 2023 |
|
|
// agent.did is for legacy data, before March 2023 |
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
const giverDid = claim.agent?.identifier || (claim.agent as any)?.did; |
|
|
const giverDid = claim.agent?.identifier || (claim.agent as any)?.did; |
|
|
const giverInfo = didInfo( |
|
|
const giverInfo = didInfo( |
|
|
giverDid, |
|
|
giverDid, |
|
@ -402,6 +402,7 @@ export default class HomeView extends Vue { |
|
|
: claim.description || "something unknown"; |
|
|
: claim.description || "something unknown"; |
|
|
// recipient.did is for legacy data, before March 2023 |
|
|
// recipient.did is for legacy data, before March 2023 |
|
|
const gaveRecipientId = |
|
|
const gaveRecipientId = |
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
claim.recipient?.identifier || (claim.recipient as any)?.did; |
|
|
claim.recipient?.identifier || (claim.recipient as any)?.did; |
|
|
const gaveRecipientInfo = gaveRecipientId |
|
|
const gaveRecipientInfo = gaveRecipientId |
|
|
? " to " + |
|
|
? " to " + |
|
@ -515,16 +516,19 @@ export default class HomeView extends Vue { |
|
|
-1, |
|
|
-1, |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
|
|
|
} catch (error: any) { |
|
|
console.log("Error with give caught:", error); |
|
|
console.log("Error with give caught:", error); |
|
|
|
|
|
const message = |
|
|
|
|
|
error.userMessage || |
|
|
|
|
|
error.response?.data?.error?.message || |
|
|
|
|
|
"There was an error recording the give."; |
|
|
this.$notify( |
|
|
this.$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
|
title: "Error", |
|
|
title: "Error", |
|
|
text: |
|
|
text: message, |
|
|
this.getGiveErrorMessage(error) || |
|
|
|
|
|
"There was an error recording the give.", |
|
|
|
|
|
}, |
|
|
}, |
|
|
-1, |
|
|
-1, |
|
|
); |
|
|
); |
|
@ -533,16 +537,14 @@ export default class HomeView extends Vue { |
|
|
|
|
|
|
|
|
// Helper functions for readability |
|
|
// Helper functions for readability |
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
isGiveCreationError(result: any) { |
|
|
isGiveCreationError(result: any) { |
|
|
return result.status !== 201 || result.data?.error; |
|
|
return result.status !== 201 || result.data?.error; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
getGiveCreationErrorMessage(result: any) { |
|
|
getGiveCreationErrorMessage(result: any) { |
|
|
return result.data?.error?.message; |
|
|
return result.data?.error?.message; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getGiveErrorMessage(error: any) { |
|
|
|
|
|
return error.userMessage || error.response?.data?.error?.message; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|