fix: pubAdd chrono init

This commit is contained in:
Thibaut Valentin 2025-12-17 21:00:43 +01:00
parent c5f7b81ac3
commit a1b5ca2694
2 changed files with 7 additions and 1 deletions

View File

@ -21,11 +21,17 @@ export function ChronoPanel() {
return chrono.time + Date.now() - chrono.startTime return chrono.time + Date.now() - chrono.startTime
} }
useEffect(() => {
publicAffDispatch({type: 'CALL_TIME', payload: {timeStr: state.current.lastTimeStr, timeColor: state.current.color}})
}, [])
useEffect(() => { useEffect(() => {
const blinkRfDuration = 20 const blinkRfDuration = 20
const state_ = state.current const state_ = state.current
const text_ = chronoText.current const text_ = chronoText.current
publicAffDispatch({type: 'CALL_TIME', payload: {timeStr: state.current.lastTimeStr, timeColor: state.current.color}})
const timer = setInterval(() => { const timer = setInterval(() => {
let currentDuration = config.time let currentDuration = config.time
let color = "black" let color = "black"

View File

@ -14,7 +14,7 @@ const text2Style = {fontSize: "min(1.7vw, 7vh)", fontWeight: "bold"};
export function PubAffWindow({document}) { export function PubAffWindow({document}) {
const chronoText = useRef(null) const chronoText = useRef(null)
const state2 = useRef({lastColor: "white", lastTimeStr: "01:30"}) const state2 = useRef({lastColor: "white", lastTimeStr: "--:--"})
const state = usePubAffState(); const state = usePubAffState();
document.title = "A React portal window" document.title = "A React portal window"