From 375d6ddbe2a9bb74d7b9d8a32f51ce7c471f5c7e Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 28 Jul 2024 17:08:44 -0600 Subject: [PATCH] fix problem detecting plans when editing gifts --- src/views/GiftedDetails.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/GiftedDetails.vue b/src/views/GiftedDetails.vue index fc82db4..6f6c374 100644 --- a/src/views/GiftedDetails.vue +++ b/src/views/GiftedDetails.vue @@ -249,9 +249,10 @@ export default class GiftedDetails extends Vue { ); } + const prevAmount = this.prevCredToEdit?.claim?.object?.amountOfThisGood; this.amountInput = (this.$route as Router).query["amountInput"] || - String(this.prevCredToEdit?.claim?.object?.amountOfThisGood) || + (prevAmount ? String(prevAmount) : "") || this.amountInput; this.description = (this.$route as Router).query["description"] || @@ -275,13 +276,13 @@ export default class GiftedDetails extends Vue { : fulfills ? [fulfills] : []; - const offer = fulfillsArray.find((rec) => rec.claimType === "Offer"); + const offer = fulfillsArray.find((rec) => rec["@type"] === "Offer"); this.offerId = ((this.$route as Router).query["offerId"] || offer?.identifier || this.offerId) as string; // find any project ID - const project = fulfillsArray.find((rec) => rec.claimType === "PlanAction"); + const project = fulfillsArray.find((rec) => rec["@type"] === "PlanAction"); this.projectId = ((this.$route as Router).query["projectId"] || project?.identifier || this.projectId) as string;