From 6272b3045bb25ab2721acc4b0af75977a5a11037 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 28 Jul 2024 17:09:06 -0600 Subject: [PATCH] fix where it doesn't remove the plan when editing and removing it --- src/libs/endorserServer.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index ce2b575..06a3f28 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -604,19 +604,19 @@ export function hydrateGive( } // ... and replace or add each element, ending with Trade or Donate // I realize this doesn't change any elements that are not PlanAction or Offer or Trade/Action. + vcClaim.fulfills = vcClaim.fulfills.filter( + (elem) => elem["@type"] !== "PlanAction", + ); if (fulfillsProjectHandleId) { - vcClaim.fulfills = vcClaim.fulfills.filter( - (elem) => elem["@type"] !== "PlanAction", - ); vcClaim.fulfills.push({ "@type": "PlanAction", identifier: fulfillsProjectHandleId, }); } + vcClaim.fulfills = vcClaim.fulfills.filter( + (elem) => elem["@type"] !== "Offer", + ); if (fulfillsOfferHandleId) { - vcClaim.fulfills = vcClaim.fulfills.filter( - (elem) => elem["@type"] !== "Offer", - ); vcClaim.fulfills.push({ "@type": "Offer", identifier: fulfillsOfferHandleId,