From 22f3e523ea714d9481ad226326dede418d9b41aa Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Sun, 26 Jul 2026 02:54:59 +0200 Subject: [PATCH] fix: reset chain when venue changes, reset venue when chain has no data for it --- src/components/benchmark-body.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/benchmark-body.tsx b/src/components/benchmark-body.tsx index b50d7742..87a624f2 100644 --- a/src/components/benchmark-body.tsx +++ b/src/components/benchmark-body.tsx @@ -667,7 +667,7 @@ export function BenchmarkBody({ label="Venue" options={filteredVenueOptions} selected={venue ?? fallbackVenue} - onSelect={setVenue} + onSelect={(v) => { setVenue(v); setChain(null); }} metaByValue={Object.fromEntries( filteredVenueOptions .map((o) => [ @@ -703,7 +703,13 @@ export function BenchmarkBody({ label="Chain" options={filteredChainOptions} selected={chain ?? fallbackChain} - onSelect={setChain} + onSelect={(v) => { + setChain(v); + if (v !== "all" && effectiveVenue && effectiveVenue !== "all" && venuesForChain) { + const validVenues = venuesForChain[v]; + if (validVenues && !validVenues.includes(effectiveVenue)) setVenue(null); + } + }} metaByValue={Object.fromEntries( filteredChainOptions .map((o) => [