From a4418a2aa9afede0afc6bdc67354177cc800ba4d Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 7 Mar 2026 03:42:10 +0900 Subject: [PATCH] fix cool time --- src/App.jsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 96239a0..2970a5e 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -93,9 +93,13 @@ export default function App() { }, [playAnim]); const appStartRef = useRef(Date.now()); + const lastSwitchRef = useRef(0); const handleZoomOut = useCallback(() => { - // 起動後15秒は切り替え無効 - if (Date.now() - appStartRef.current < 15000) return; + const now = Date.now(); + // 起動後15秒、または切り替え後5秒はブロック + if (now - appStartRef.current < 15000) return; + if (now - lastSwitchRef.current < 5000) return; + lastSwitchRef.current = now; setView('nasa'); }, []); @@ -134,9 +138,9 @@ export default function App() { {/* NASA center button */} {isNasa && (