fix: disallow affirming delivery of orders where giver is hidden
This commit is contained in:
@@ -472,7 +472,7 @@ export function offerGiverDid(
|
|||||||
if (giver && !serverUtil.isHiddenDid(giver)) {
|
if (giver && !serverUtil.isHiddenDid(giver)) {
|
||||||
return giver;
|
return giver;
|
||||||
}
|
}
|
||||||
return giver;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -223,14 +223,23 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<button
|
<button
|
||||||
v-if="libsUtil.canFulfillOffer(veriClaim, isRegistered)"
|
v-if="veriClaim.claimType === 'Offer'"
|
||||||
class="col-span-1 block w-fit text-center text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
class="col-span-1 block w-fit text-center text-md px-1.5 py-2 rounded-md"
|
||||||
@click="openFulfillGiftDialog()"
|
:class="
|
||||||
|
libsUtil.canFulfillOffer(veriClaim, isRegistered)
|
||||||
|
? 'bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white'
|
||||||
|
: 'bg-gray-300 text-gray-500 cursor-pointer opacity-50'
|
||||||
|
"
|
||||||
|
@click="handleAffirmDeliveryClick()"
|
||||||
>
|
>
|
||||||
Affirm Delivery
|
Affirm Delivery
|
||||||
<font-awesome
|
<font-awesome
|
||||||
icon="hand-holding-heart"
|
icon="hand-holding-heart"
|
||||||
class="ml-2 text-white cursor-pointer"
|
:class="
|
||||||
|
libsUtil.canFulfillOffer(veriClaim, isRegistered)
|
||||||
|
? 'ml-2 text-white cursor-pointer'
|
||||||
|
: 'ml-2 text-gray-500 cursor-pointer'
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -1103,6 +1112,20 @@ export default class ClaimView extends Vue {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleAffirmDeliveryClick() {
|
||||||
|
if (!this.isRegistered) {
|
||||||
|
this.notify.error("You must be registered to affirm delivery.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!libsUtil.canFulfillOffer(this.veriClaim, this.isRegistered)) {
|
||||||
|
this.notify.error(
|
||||||
|
"You cannot see all the information in this offer so you cannot affirm delivery.",
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.openFulfillGiftDialog();
|
||||||
|
}
|
||||||
|
|
||||||
openFulfillGiftDialog() {
|
openFulfillGiftDialog() {
|
||||||
const giver: libsUtil.GiverReceiverInputInfo = {
|
const giver: libsUtil.GiverReceiverInputInfo = {
|
||||||
did: libsUtil.offerGiverDid(
|
did: libsUtil.offerGiverDid(
|
||||||
|
|||||||
Reference in New Issue
Block a user