Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Reset dependent fields on entity change in ConditionLogic

Steven Teydd93b569f692
diff --git a/apps/web/ui/partners/rewards/rewards-logic.tsx b/apps/web/ui/partners/rewards/rewards-logic.tsx
index 755e000c13..9d3abd7a77 100644
--- a/apps/web/ui/partners/rewards/rewards-logic.tsx
+++ b/apps/web/ui/partners/rewards/rewards-logic.tsx
@@ -314,7 +314,13 @@ function ConditionLogic({
onSelect={(value) =>
setValue(
conditionKey,
- { entity: value as keyof typeof ENTITIES },
+ {
+ entity: value as keyof typeof ENTITIES,
+ // Clear dependent fields when entity changes
+ attribute: undefined,
+ operator: undefined,
+ value: undefined,
+ },
{
shouldDirty: true,
},