From d3b80fbe47bdd94115b27df440e74842b75bdb82 Mon Sep 17 00:00:00 2001
From: Jose Olarte III
Date: Fri, 20 Jun 2025 18:38:35 +0800
Subject: [PATCH] Feature: giver-recipient validation
- Ensures person-to-person gifting won't allow the same entity as giver and recipient
- Disable user item selection if it would create conflict
- Error messaging fallback
---
src/components/GiftedDialog.vue | 100 ++++++++++++++++++++++++++++----
1 file changed, 90 insertions(+), 10 deletions(-)
diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue
index 076e1f0d..af6dee5c 100644
--- a/src/components/GiftedDialog.vue
+++ b/src/components/GiftedDialog.vue
@@ -80,16 +80,29 @@
stepType === 'recipient' ||
(stepType === 'giver' && isFromProjectView)
"
- class="cursor-pointer"
+ :class="{
+ 'cursor-pointer': !wouldCreateConflict(activeDid),
+ 'cursor-not-allowed opacity-50': wouldCreateConflict(activeDid)
+ }"
@click="
- stepType === 'recipient'
+ !wouldCreateConflict(activeDid) &&
+ (stepType === 'recipient'
? selectRecipient({ did: activeDid, name: 'You' })
- : selectGiver({ did: activeDid, name: 'You' })
+ : selectGiver({ did: activeDid, name: 'You' }))
"
>
-
+
You
@@ -119,11 +132,15 @@
@@ -141,7 +158,10 @@
{{ contact.name || contact.did }}
@@ -425,9 +445,22 @@
@click="explainData()"
/>
+
+
+
+
+
+ Cannot record: Same person selected as both giver and recipient
+
+
+