forked from jsnbuchanan/crowd-funder-for-time-pwa
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)) {
|
||||
return giver;
|
||||
}
|
||||
return giver;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -223,14 +223,23 @@
|
||||
</div>
|
||||
<div class="mt-8">
|
||||
<button
|
||||
v-if="libsUtil.canFulfillOffer(veriClaim, isRegistered)"
|
||||
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"
|
||||
@click="openFulfillGiftDialog()"
|
||||
v-if="veriClaim.claimType === 'Offer'"
|
||||
class="col-span-1 block w-fit text-center text-md px-1.5 py-2 rounded-md"
|
||||
: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
|
||||
<font-awesome
|
||||
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>
|
||||
</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() {
|
||||
const giver: libsUtil.GiverReceiverInputInfo = {
|
||||
did: libsUtil.offerGiverDid(
|
||||
|
||||
Reference in New Issue
Block a user