From 0efb987e0d065d5bd2274909ccfa82290ed5247c Mon Sep 17 00:00:00 2001 From: streakingman Date: Fri, 16 Sep 2022 11:27:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A8=E7=94=BB=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 6c32a52..7ea6a6b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -142,6 +142,7 @@ const App: FC = () => { >({}); const [finished, setFinished] = useState(false); const [tipText, setTipText] = useState(''); + const [animating, setAnimating] = useState(false); // 队列区排序 useEffect(() => { @@ -262,7 +263,7 @@ const App: FC = () => { // 点击item const clickSymbol = async (idx: number) => { - if (finished) return; + if (finished || animating) return; const updateScene = scene.slice(); const symbol = updateScene[idx]; if (symbol.isCover || symbol.status !== 0) return; @@ -274,6 +275,7 @@ const App: FC = () => { setQueue(updateQueue); checkCover(updateScene); + setAnimating(true); await waitTimeout(300); const filterSame = updateQueue.filter((sb) => sb.icon === symbol.icon); @@ -308,6 +310,8 @@ const App: FC = () => { setQueue(updateQueue); checkCover(updateScene); } + + setAnimating(false); }; return (