fix: pubAdd chrono init
This commit is contained in:
parent
c5f7b81ac3
commit
a1b5ca2694
@ -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"
|
||||||
|
|||||||
@ -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"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user