Skip to content

Commit e5d1dd3

Browse files
committed
experiments: clear the track-liveness map when the tab deactivates (review)
1 parent 6e88448 commit e5d1dd3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/components/ExperimentsOverview.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,13 @@ function PromotedTraffic({ enabled }: { enabled: boolean }) {
782782
const [trackDisabled, setTrackDisabled] = useState<Map<string, boolean> | null>(null);
783783
const [showCulled, setShowCulled] = useState(false);
784784
useEffect(() => {
785-
if (!enabled || !isAuthenticated) return;
785+
if (!enabled || !isAuthenticated) {
786+
// Drop the map when the tab deactivates or auth lapses, mirroring the
787+
// traffic effect's reset: a stale map must not keep hiding/badging cards
788+
// when we can no longer (re)fetch liveness.
789+
setTrackDisabled(null);
790+
return;
791+
}
786792
let cancelled = false;
787793
fetchTracks()
788794
.then((d) => {

0 commit comments

Comments
 (0)