|
|
@@ -9,14 +9,13 @@ import cls from './leftbox.module.less'; |
|
|
|
|
|
|
|
const Chart2 = () => { |
|
|
|
const ctx = useContext(SocketContext); |
|
|
|
let [restTime, setResttime] = useState( |
|
|
|
ctx.runState?.lastFireChangeTime || '0分0秒', |
|
|
|
); |
|
|
|
let [time, setTime] = useState([0, 0]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
let timer = null; |
|
|
|
const restTime = ctx.runState?.lastFireChangeTime; |
|
|
|
if (restTime == null) return; |
|
|
|
console.log('restTime is:', restTime); |
|
|
|
let timer = null; |
|
|
|
if (/分/.test(restTime) && /秒/.test(restTime)) { |
|
|
|
let [min, sec] = restTime.replace(/分/, ':').replace(/秒/, '').split(':'); |
|
|
|
timer = setInterval(() => { |
|
|
|