From a1b5ca26944abc1fbef74a2d5fbfd36b13a3e172 Mon Sep 17 00:00:00 2001 From: Thibaut Valentin Date: Wed, 17 Dec 2025 21:00:43 +0100 Subject: [PATCH] fix: pubAdd chrono init --- .../webapp/src/pages/competition/editor/CMTChronoPanel.jsx | 6 ++++++ .../webapp/src/pages/competition/editor/PubAffWindow.jsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/src/pages/competition/editor/CMTChronoPanel.jsx b/src/main/webapp/src/pages/competition/editor/CMTChronoPanel.jsx index f779c92..40ac209 100644 --- a/src/main/webapp/src/pages/competition/editor/CMTChronoPanel.jsx +++ b/src/main/webapp/src/pages/competition/editor/CMTChronoPanel.jsx @@ -21,11 +21,17 @@ export function ChronoPanel() { return chrono.time + Date.now() - chrono.startTime } + useEffect(() => { + publicAffDispatch({type: 'CALL_TIME', payload: {timeStr: state.current.lastTimeStr, timeColor: state.current.color}}) + }, []) + useEffect(() => { const blinkRfDuration = 20 const state_ = state.current const text_ = chronoText.current + publicAffDispatch({type: 'CALL_TIME', payload: {timeStr: state.current.lastTimeStr, timeColor: state.current.color}}) + const timer = setInterval(() => { let currentDuration = config.time let color = "black" diff --git a/src/main/webapp/src/pages/competition/editor/PubAffWindow.jsx b/src/main/webapp/src/pages/competition/editor/PubAffWindow.jsx index 052b9de..39cba7a 100644 --- a/src/main/webapp/src/pages/competition/editor/PubAffWindow.jsx +++ b/src/main/webapp/src/pages/competition/editor/PubAffWindow.jsx @@ -14,7 +14,7 @@ const text2Style = {fontSize: "min(1.7vw, 7vh)", fontWeight: "bold"}; export function PubAffWindow({document}) { const chronoText = useRef(null) - const state2 = useRef({lastColor: "white", lastTimeStr: "01:30"}) + const state2 = useRef({lastColor: "white", lastTimeStr: "--:--"}) const state = usePubAffState(); document.title = "A React portal window"