mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 15:39:11 +00:00
fix: presenter view
presenter view shows time correctly when rolling
This commit is contained in:
@@ -37,7 +37,7 @@ const withSocket = (Component) => {
|
|||||||
});
|
});
|
||||||
const [timer, setTimer] = useState({
|
const [timer, setTimer] = useState({
|
||||||
clock: null,
|
clock: null,
|
||||||
currentSeconds: null,
|
running: null,
|
||||||
startedAt: null,
|
startedAt: null,
|
||||||
expectedFinish: null,
|
expectedFinish: null,
|
||||||
});
|
});
|
||||||
@@ -221,7 +221,7 @@ const withSocket = (Component) => {
|
|||||||
// get clock string
|
// get clock string
|
||||||
const timeManager = {
|
const timeManager = {
|
||||||
...timer,
|
...timer,
|
||||||
finished: timer.running <= 0 && timer.startedAt,
|
finished: playback === 'start' && timer.running <= 0 && timer.startedAt,
|
||||||
clock: stringFromMillis(timer.clock),
|
clock: stringFromMillis(timer.clock),
|
||||||
playstate: playback,
|
playstate: playback,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,10 +14,9 @@ export default function PresenterView(props) {
|
|||||||
document.title = 'ontime - Speaker Screen';
|
document.title = 'ontime - Speaker Screen';
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const showOverlay = pres.text !== '' && pres.visible;
|
const showOverlay = pres.text !== '' && pres.visible;
|
||||||
const isPlaying = time.playstate === 'start';
|
const isPlaying = time.playstate !== 'pause';
|
||||||
|
const normalisedTime = Math.max(time.running, 0);
|
||||||
|
|
||||||
// motion
|
// motion
|
||||||
const titleVariants = {
|
const titleVariants = {
|
||||||
@@ -61,7 +60,7 @@ export default function PresenterView(props) {
|
|||||||
<div className={style.finished}>TIME UP</div>
|
<div className={style.finished}>TIME UP</div>
|
||||||
) : (
|
) : (
|
||||||
<div className={isPlaying ? style.countdown : style.countdownPaused}>
|
<div className={isPlaying ? style.countdown : style.countdownPaused}>
|
||||||
<Countdown time={time.currentSeconds} hideZeroHours />
|
<Countdown time={normalisedTime} hideZeroHours />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -73,7 +72,7 @@ export default function PresenterView(props) {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MyProgressBar
|
<MyProgressBar
|
||||||
now={time.currentSeconds}
|
now={normalisedTime}
|
||||||
complete={time.durationSeconds}
|
complete={time.durationSeconds}
|
||||||
showElapsed
|
showElapsed
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user