Skip to content

Commit 7bdfe9d

Browse files
committed
fix random conditon in sandbox
1 parent 82c9732 commit 7bdfe9d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/public/viz-guardrails/hooks/useRandomGuardrail.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export function useRandomGuardrail({
2121
);
2222
const shuffled = d3.shuffle(unselected).slice(0, numRandomSamples);
2323
setRandomCountries(shuffled);
24-
} else {
25-
setRandomCountries([]);
24+
return;
2625
}
27-
// eslint-disable-next-line react-hooks/exhaustive-deps
28-
}, []);
26+
27+
setRandomCountries([]);
28+
}, [guardrail, selection, allCountries, numRandomSamples]);
2929

3030
return randomCountries;
3131
}

0 commit comments

Comments
 (0)