From f3e50e7353e6b3f655a4815d03fb6348ce0e0953 Mon Sep 17 00:00:00 2001 From: claustra01 Date: Sun, 11 Aug 2024 12:45:55 +0900 Subject: [PATCH] test --- src/pages/shooter/index.tsx | 10 ++++------ src/pages/yatai/index.tsx | 38 +++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/pages/shooter/index.tsx b/src/pages/shooter/index.tsx index ad9a43a..99fc0de 100644 --- a/src/pages/shooter/index.tsx +++ b/src/pages/shooter/index.tsx @@ -57,18 +57,16 @@ const Shooter = () => { useEffect(() => { let intervalId: number | null = null; - if (!isOpen) { - intervalId = window.setInterval(() => { - sendData(message_type.status); - }, 100); - } + intervalId = window.setInterval(() => { + sendData(message_type.status); + }, 100); return () => { if (intervalId !== null) { clearInterval(intervalId); } }; - }, [isOpen, sendData]); + }, [sendData]); const handleClick = () => { const audio = new Audio("/sound/cork_sound.mp3"); diff --git a/src/pages/yatai/index.tsx b/src/pages/yatai/index.tsx index e201cd4..d5572d3 100644 --- a/src/pages/yatai/index.tsx +++ b/src/pages/yatai/index.tsx @@ -124,7 +124,7 @@ const YataiStage = React.memo(() => { ); }); -function Yatai() { +const TargetOverlay = () => { const socketRef = useSocketRefStore((state) => state.socketRef); useEffect(() => { @@ -158,24 +158,30 @@ function Yatai() { // setTarget(data.target); // }; + return ( +
+ 照準の表示 +
+ ); +}; + +function Yatai() { return (
-
- 照準の表示 -
+
); }