Fix offer fulfillment detection + consistencies between ClaimView and ConfirmGiftView #167
@@ -739,13 +739,18 @@ export default class ClaimView extends Vue {
|
||||
}
|
||||
|
||||
const fulfills = this.detailsForGive.fullClaim.fulfills;
|
||||
if (!Array.isArray(fulfills)) {
|
||||
this.detailsForGiveOfferFulfillment = null;
|
||||
return;
|
||||
|
||||
// Handle both array and single object cases
|
||||
let offerFulfill = null;
|
||||
|
||||
if (Array.isArray(fulfills)) {
|
||||
// Find the Offer in the fulfills array
|
||||
offerFulfill = fulfills.find((item) => item["@type"] === "Offer");
|
||||
} else if (fulfills["@type"] === "Offer") {
|
||||
// fulfills is a single Offer object
|
||||
offerFulfill = fulfills;
|
||||
}
|
||||
|
||||
// Find the Offer in the fulfills array
|
||||
const offerFulfill = fulfills.find((item) => item["@type"] === "Offer");
|
||||
|
||||
if (offerFulfill) {
|
||||
this.detailsForGiveOfferFulfillment = {
|
||||
offerHandleId: offerFulfill.identifier,
|
||||
|
||||
Reference in New Issue
Block a user