Skip to content

Commit 4057c2f

Browse files
committed
fix(cmd-k): Remove redundant sync effect that broke no-results detection
The separate prevFilteredCount sync effect ran before the no-results effect in declaration order, zeroing out the previous value before the check could compare it. The no-results effect already updates prevFilteredCount itself, so the sync effect was both redundant and harmful.
1 parent b6239ef commit 4057c2f

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

static/app/components/commandPalette/useCommandPaletteAnalytics.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ export function useCommandPaletteAnalytics(filteredActionCount: number): {
6161
analyticsState.current.state = state;
6262
}, [state]);
6363

64-
// Sync filtered count to ref so the debounce timer reads the latest value
65-
// without restarting on async result changes (e.g. DSN lookup)
66-
useEffect(() => {
67-
analyticsState.current.prevFilteredCount = filteredActionCount;
68-
}, [filteredActionCount]);
69-
7064
// Debounced query tracking
7165
useEffect(() => {
7266
const s = analyticsState.current;

0 commit comments

Comments
 (0)