|
@ -250,20 +250,24 @@ export default class GiftedDetails extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.amountInput = |
|
|
this.amountInput = |
|
|
this.$route.query.amountInput || |
|
|
(this.$route as Router).query["amountInput"] || |
|
|
String(this.prevCredToEdit?.claim?.object?.amountOfThisGood) || |
|
|
String(this.prevCredToEdit?.claim?.object?.amountOfThisGood) || |
|
|
this.amountInput; |
|
|
this.amountInput; |
|
|
this.description = |
|
|
this.description = |
|
|
this.$route.query.description || |
|
|
(this.$route as Router).query["description"] || |
|
|
this.prevCredToEdit?.claim?.description || |
|
|
this.prevCredToEdit?.claim?.description || |
|
|
this.description; |
|
|
this.description; |
|
|
this.destinationPathAfter = this.$route.query.destinationPathAfter; |
|
|
this.destinationPathAfter = (this.$route as Router).query[ |
|
|
this.giverDid = (this.$route.query.giverDid || |
|
|
"destinationPathAfter" |
|
|
|
|
|
]; |
|
|
|
|
|
this.giverDid = ((this.$route as Router).query["giverDid"] || |
|
|
this.prevCredToEdit?.claim?.agent?.identifier || |
|
|
this.prevCredToEdit?.claim?.agent?.identifier || |
|
|
this.giverDid) as string; |
|
|
this.giverDid) as string; |
|
|
this.giverName = (this.$route.query.giverName as string) || ""; |
|
|
this.giverName = |
|
|
this.hideBackButton = this.$route.query.hideBackButton === "true"; |
|
|
((this.$route as Router).query["giverName"] as string) || ""; |
|
|
this.message = (this.$route.query.message as string) || ""; |
|
|
this.hideBackButton = |
|
|
|
|
|
(this.$route as Router).query["hideBackButton"] === "true"; |
|
|
|
|
|
this.message = ((this.$route as Router).query["message"] as string) || ""; |
|
|
// find any offer ID |
|
|
// find any offer ID |
|
|
const fulfills = this.prevCredToEdit?.claim?.fulfills; |
|
|
const fulfills = this.prevCredToEdit?.claim?.fulfills; |
|
|
const fulfillsArray = Array.isArray(fulfills) |
|
|
const fulfillsArray = Array.isArray(fulfills) |
|
@ -272,43 +276,44 @@ export default class GiftedDetails extends Vue { |
|
|
? [fulfills] |
|
|
? [fulfills] |
|
|
: []; |
|
|
: []; |
|
|
const offer = fulfillsArray.find((rec) => rec.claimType === "Offer"); |
|
|
const offer = fulfillsArray.find((rec) => rec.claimType === "Offer"); |
|
|
this.offerId = (this.$route.query.offerId || |
|
|
this.offerId = ((this.$route as Router).query["offerId"] || |
|
|
offer?.identifier || |
|
|
offer?.identifier || |
|
|
this.offerId) as string; |
|
|
this.offerId) as string; |
|
|
|
|
|
|
|
|
// find any project ID |
|
|
// find any project ID |
|
|
const project = fulfillsArray.find((rec) => rec.claimType === "PlanAction"); |
|
|
const project = fulfillsArray.find((rec) => rec.claimType === "PlanAction"); |
|
|
this.projectId = (this.$route.query.projectId || |
|
|
this.projectId = ((this.$route as Router).query["projectId"] || |
|
|
project?.identifier || |
|
|
project?.identifier || |
|
|
this.projectId) as string; |
|
|
this.projectId) as string; |
|
|
|
|
|
|
|
|
this.recipientDid = (this.$route.query.recipientDid || |
|
|
this.recipientDid = ((this.$route as Router).query["recipientDid"] || |
|
|
this.prevCredToEdit?.claim?.recipient?.identifier) as string; |
|
|
this.prevCredToEdit?.claim?.recipient?.identifier) as string; |
|
|
this.recipientName = (this.$route.query.recipientName as string) || ""; |
|
|
this.recipientName = |
|
|
this.unitCode = (this.$route.query.unitCode || |
|
|
((this.$route as Router).query["recipientName"] as string) || ""; |
|
|
|
|
|
this.unitCode = ((this.$route as Router).query["unitCode"] || |
|
|
this.prevCredToEdit?.claim?.object?.unitCode || |
|
|
this.prevCredToEdit?.claim?.object?.unitCode || |
|
|
this.unitCode) as string; |
|
|
this.unitCode) as string; |
|
|
|
|
|
|
|
|
this.imageUrl = |
|
|
this.imageUrl = |
|
|
(this.$route.query.imageUrl as string) || |
|
|
((this.$route as Router).query["imageUrl"] as string) || |
|
|
this.prevCredToEdit?.claim?.image || |
|
|
this.prevCredToEdit?.claim?.image || |
|
|
localStorage.getItem("imageUrl") || |
|
|
localStorage.getItem("imageUrl") || |
|
|
this.imageUrl; |
|
|
this.imageUrl; |
|
|
|
|
|
|
|
|
// this is an endpoint for sharing project info to highlight something given |
|
|
// this is an endpoint for sharing project info to highlight something given |
|
|
// https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target |
|
|
// https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target |
|
|
if (this.$route.query.shareTitle) { |
|
|
if ((this.$route as Router).query["shareTitle"]) { |
|
|
this.description = |
|
|
this.description = |
|
|
(this.$route.query.shareTitle as string) + |
|
|
((this.$route as Router).query["shareTitle"] as string) + |
|
|
(this.description ? "\n" + this.description : ""); |
|
|
(this.description ? "\n" + this.description : ""); |
|
|
} |
|
|
} |
|
|
if (this.$route.query.shareText) { |
|
|
if ((this.$route as Router).query["shareText"]) { |
|
|
this.description = |
|
|
this.description = |
|
|
(this.description ? this.description + "\n" : "") + |
|
|
(this.description ? this.description + "\n" : "") + |
|
|
(this.$route.query.shareText as string); |
|
|
((this.$route as Router).query["shareText"] as string); |
|
|
} |
|
|
} |
|
|
if (this.$route.query.shareUrl) { |
|
|
if ((this.$route as Router).query["shareUrl"]) { |
|
|
this.imageUrl = this.$route.query.shareUrl as string; |
|
|
this.imageUrl = (this.$route as Router).query["shareUrl"] as string; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
@ -688,6 +693,7 @@ export default class GiftedDetails extends Vue { |
|
|
constructGiveParam() { |
|
|
constructGiveParam() { |
|
|
const recipientDid = this.givenToRecipient ? this.recipientDid : undefined; |
|
|
const recipientDid = this.givenToRecipient ? this.recipientDid : undefined; |
|
|
const projectId = this.givenToProject ? this.projectId : undefined; |
|
|
const projectId = this.givenToProject ? this.projectId : undefined; |
|
|
|
|
|
// const giveClaim = constructGive( |
|
|
const giveClaim = hydrateGive( |
|
|
const giveClaim = hydrateGive( |
|
|
this.prevCredToEdit?.claim as GiveVerifiableCredential, |
|
|
this.prevCredToEdit?.claim as GiveVerifiableCredential, |
|
|
this.giverDid, |
|
|
this.giverDid, |
|
|