Display closes clue on timeout
This commit is contained in:
parent
777bea93ac
commit
de3a767425
@ -11,9 +11,14 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ClueDisplay = ({ activeClue }: 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(() => {
|
useEffect(() => {
|
||||||
socket.on("clue-clock-on", start);
|
socket.on("clue-clock-on", start);
|
||||||
|
socket.on("contestant-buzzed", cancel);
|
||||||
|
socket.on("contestant-penalized", start);
|
||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user