From 637dfef636750e6ce23294e8d057508da3b1a758 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Tue, 31 Aug 2021 14:34:18 -0700 Subject: [PATCH] Fix double tap timeout --- src/VideoGrid.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/VideoGrid.jsx b/src/VideoGrid.jsx index 7c760e00..e69edc05 100644 --- a/src/VideoGrid.jsx +++ b/src/VideoGrid.jsx @@ -548,15 +548,11 @@ export function VideoGrid({ participants }) { (tileKey) => { const lastTapped = lastTappedRef.current[tileKey]; - if (!lastTapped) { + if (!lastTapped || Date.now() - lastTapped > 500) { lastTappedRef.current[tileKey] = Date.now(); return; } - if (Date.now() - lastTapped > 500) { - return; - } - lastTappedRef.current[tileKey] = 0; const tile = tiles.find((tile) => tile.key === tileKey);