Skip to content

Commit

Permalink
more reacty
Browse files Browse the repository at this point in the history
by leo
  • Loading branch information
fiji-flo committed Sep 14, 2023
1 parent f60e261 commit abb30e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/src/ui/organisms/placement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,14 @@ export function PlacementInner({
timeout: window.setTimeout(sendViewed, 1000),
};
}
} else if (timer.current.timeout !== null) {
}
}
return () => {
if (timer.current.timeout !== null && timer.current.timeout !== -1) {
clearTimeout(timer.current.timeout);
timer.current = { timeout: null };
}
}
};
}, [isVisible, isIntersecting, sendViewed]);

const { image, copy } = pong?.fallback || pong || {};
Expand Down

0 comments on commit abb30e1

Please sign in to comment.