From de3a767425fe4114f596ee7446c7ce5e54d4e920 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Sat, 25 Feb 2023 12:43:16 -0600 Subject: [PATCH] Display closes clue on timeout --- src/display/ClueDisplay.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/display/ClueDisplay.tsx b/src/display/ClueDisplay.tsx index c13d16c..95654b3 100644 --- a/src/display/ClueDisplay.tsx +++ b/src/display/ClueDisplay.tsx @@ -11,9 +11,14 @@ interface Props { } const ClueDisplay = ({ activeClue }: Props) => { - const { start, segs } = useTimer(5000); + const onTimeout = () => { + socket.emit("clue-clock-timeout"); + }; + const { start, cancel, segs } = useTimer(5000, onTimeout); useEffect(() => { socket.on("clue-clock-on", start); + socket.on("contestant-buzzed", cancel); + socket.on("contestant-penalized", start); }, []); return ( <>