forked from trent_larson/crowd-funder-for-time-pwa
chore: Rename variable for clarity
This commit is contained in:
@@ -102,7 +102,9 @@
|
||||
<router-link
|
||||
:to="
|
||||
'/project/' +
|
||||
encodeURIComponent(giveDetails?.fulfillsPlanHandleId || '')
|
||||
encodeURIComponent(
|
||||
giveDetails?.fulfillsPlanHandleId || '',
|
||||
)
|
||||
"
|
||||
class="text-blue-500 mt-2 cursor-pointer"
|
||||
>
|
||||
@@ -113,21 +115,23 @@
|
||||
/>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Show offer fulfillment if this give fulfills an offer -->
|
||||
<div v-if="offerFulfillment?.offerHandleId">
|
||||
<div v-if="giveDetailsOfferFulfillment?.offerHandleId">
|
||||
<!-- router-link to /claim/ only changes URL path -->
|
||||
<router-link
|
||||
:to="
|
||||
'/claim/' +
|
||||
encodeURIComponent(offerFulfillment.offerHandleId || '')
|
||||
encodeURIComponent(
|
||||
giveDetailsOfferFulfillment.offerHandleId || '',
|
||||
)
|
||||
"
|
||||
class="text-blue-500 mt-2 cursor-pointer"
|
||||
>
|
||||
This fulfills
|
||||
{{
|
||||
capitalizeAndInsertSpacesBeforeCapsWithAPrefix(
|
||||
offerFulfillment.offerType || "Offer",
|
||||
giveDetailsOfferFulfillment.offerType || "Offer",
|
||||
)
|
||||
}}
|
||||
<font-awesome
|
||||
@@ -490,7 +494,7 @@ export default class ConfirmGiftView extends Vue {
|
||||
confsVisibleToIdList: string[] = []; // list of DIDs that can see any confirmer
|
||||
giveDetails?: GiveSummaryRecord;
|
||||
// Additional offer information extracted from the fulfills array
|
||||
offerFulfillment: {
|
||||
giveDetailsOfferFulfillment: {
|
||||
offerHandleId?: string;
|
||||
offerType?: string;
|
||||
} | null = null;
|
||||
@@ -715,25 +719,25 @@ export default class ConfirmGiftView extends Vue {
|
||||
*/
|
||||
private extractOfferFulfillment() {
|
||||
if (!this.giveDetails?.fullClaim?.fulfills) {
|
||||
this.offerFulfillment = null;
|
||||
this.giveDetailsOfferFulfillment = null;
|
||||
return;
|
||||
}
|
||||
|
||||
const fulfills = this.giveDetails.fullClaim.fulfills;
|
||||
if (!Array.isArray(fulfills)) {
|
||||
this.offerFulfillment = null;
|
||||
this.giveDetailsOfferFulfillment = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the Offer in the fulfills array
|
||||
const offerFulfill = fulfills.find((item) => item["@type"] === "Offer");
|
||||
if (offerFulfill) {
|
||||
this.offerFulfillment = {
|
||||
this.giveDetailsOfferFulfillment = {
|
||||
offerHandleId: offerFulfill.identifier,
|
||||
offerType: offerFulfill["@type"],
|
||||
};
|
||||
} else {
|
||||
this.offerFulfillment = null;
|
||||
this.giveDetailsOfferFulfillment = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user