Skip to content

Commit e6572d5

Browse files
committed
chore: explicit-dispute-kit-selection
1 parent a374113 commit e6572d5

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

web/src/pages/Resolver/Parameters/Court.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,10 @@ const Court: React.FC = () => {
187187
);
188188
}, [supportedDisputeKits, availableDisputeKits]);
189189

190-
const selectedDisputeKitId = useMemo(() => {
191-
// If there's only 1 supported dispute kit, select it by default
192-
if (disputeKitOptions.length === 1) {
193-
return disputeKitOptions[0].value;
194-
}
195-
// If there's no saved selection, select nothing
196-
return disputeData.disputeKitId ?? -1;
197-
}, [disputeKitOptions, disputeData.disputeKitId]);
198-
199190
const isGatedDisputeKit = useMemo(() => {
200-
const options = disputeKitOptions.find((dk) => String(dk.value) === String(selectedDisputeKitId));
191+
const options = disputeKitOptions.find((dk) => String(dk.value) === String(disputeData.disputeKitId));
201192
return options?.gated ?? false;
202-
}, [disputeKitOptions, selectedDisputeKitId]);
193+
}, [disputeKitOptions, disputeData.disputeKitId]);
203194

204195
// Token validation for token gate address (conditional based on ERC1155 checkbox)
205196
const tokenGateAddress = (disputeData.disputeKitData as IGatedDisputeData)?.tokenGate ?? "";
@@ -311,7 +302,7 @@ const Court: React.FC = () => {
311302
<StyledDropdownSelect
312303
items={disputeKitOptions}
313304
placeholder={{ text: "Select Dispute Kit" }}
314-
defaultValue={selectedDisputeKitId}
305+
defaultValue={disputeData.disputeKitId}
315306
callback={handleDisputeKitChange}
316307
/>
317308
)}

0 commit comments

Comments
 (0)