Display closes clue on timeout

This commit is contained in:
Dane Johnson 2023-02-25 12:43:16 -06:00
parent 777bea93ac
commit de3a767425

View File

@ -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 (
<>