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