From 628fcc9359c4c3f4e41c47a05da824cab2b51db9 Mon Sep 17 00:00:00 2001 From: alikia2x Date: Wed, 1 Jan 2025 18:46:49 +0800 Subject: [PATCH] update: index.tsx --- pages/rewind/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/rewind/index.tsx b/pages/rewind/index.tsx index bb46ed0..09c2724 100644 --- a/pages/rewind/index.tsx +++ b/pages/rewind/index.tsx @@ -39,6 +39,7 @@ function Image({ src }: { src: string }) { ); } +// TODO: Memory optimization export default function RewindPage() { const { port, apiKey } = useAtomValue(apiInfoAtom); const [timeline, setTimeline] = useState([]); @@ -168,9 +169,9 @@ export default function RewindPage() { const handleScroll = (e: React.WheelEvent) => { if (!containerRef.current || !currentFrameId) return; - // Only allow scroll changes every 80ms + // Only allow scroll changes every 30ms const now = Date.now(); - if (now - lastScrollTime.current < 80) return; + if (now - lastScrollTime.current < 30) return; lastScrollTime.current = now; const delta = Math.sign(e.deltaY);