Don't queue packets while the page is hidden

This commit is contained in:
Jack Kingsman
2026-02-25 17:32:35 -08:00
parent a406e00229
commit f003bda7b2

View File

@@ -390,6 +390,11 @@ function useVisualizerData3D({
pendingRef.current.delete(packetKey);
timersRef.current.delete(packetKey);
// Skip particle creation when tab is hidden — nobody is watching, and
// creating them now would cause a burst of animations when the tab
// becomes visible again (since rAF is paused while hidden).
if (document.hidden) return;
for (const path of pending.paths) {
const dedupedPath = dedupeConsecutive(path.nodes);
if (dedupedPath.length < 2) continue;