Clear track elapsed time display on stop event

This commit is contained in:
Fabio Manganiello 2019-02-13 17:53:57 +01:00
parent a287a10bcc
commit 4503eb31ed

View file

@ -90,6 +90,11 @@ $(document).ready(function() {
refreshElapsedInterval = undefined; refreshElapsedInterval = undefined;
} }
if (time === undefined) {
$timeElapsedElement.text('-:--');
return;
}
timeElapsed = parseInt(time); timeElapsed = parseInt(time);
$timeElapsedElement.text(secondsToTimeString(timeElapsed)); $timeElapsedElement.text(secondsToTimeString(timeElapsed));
@ -111,6 +116,9 @@ $(document).ready(function() {
if ('state' in status) { if ('state' in status) {
setState(state=status.state); setState(state=status.state);
if (status.state === 'stop') {
setTrackElapsed();
}
} }
if ('elapsed' in status) { if ('elapsed' in status) {