From e201a325eee23e93c08522f00a42a877b459340e Mon Sep 17 00:00:00 2001 From: VodBox Date: Sat, 13 Jan 2024 02:57:32 +1100 Subject: [PATCH] fix: timeout handle overload building --- src/channels/minesweeper/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/channels/minesweeper/index.tsx b/src/channels/minesweeper/index.tsx index c5ad612..7c2bc83 100644 --- a/src/channels/minesweeper/index.tsx +++ b/src/channels/minesweeper/index.tsx @@ -150,10 +150,10 @@ export function Minesweeper(props: ChannelProps) { const [gridState, dispatch] = useReducer(gridReducer, cloneDeep(stateReplicant.value!)); const [face, setFace] = useState('smile'); - const faceChangeTimeout = useRef(); + const faceChangeTimeout = useRef>(); function changeFace(face: FaceType) { - clearTimeout(faceChangeTimeout.current); + clearTimeout(faceChangeTimeout.current!); setFace(face); faceChangeTimeout.current = setTimeout(() => setFace('smile'), 2_500); } @@ -179,7 +179,7 @@ export function Minesweeper(props: ChannelProps) { } }, [gridState.nonMines]); - const flagTimeoutRef = useRef(); + const flagTimeoutRef = useRef>(); useEffect(() => { function flagTiles(timeoutMS: number) { // Add a question mark every 5-10 seconds @@ -193,7 +193,7 @@ export function Minesweeper(props: ChannelProps) { flagTiles(5_000); return () => { - clearTimeout(flagTimeoutRef.current); + clearTimeout(flagTimeoutRef.current!); }; }, []);