From f10e6147b574db8d40d0371189a14e49c019bcf3 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 18 Nov 2022 14:41:28 +0100 Subject: [PATCH] Use real call start timestamp Signed-off-by: Marco --- src/components/TopBar/CallTime.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/TopBar/CallTime.vue b/src/components/TopBar/CallTime.vue index d74a386e7..85471ac04 100644 --- a/src/components/TopBar/CallTime.vue +++ b/src/components/TopBar/CallTime.vue @@ -109,6 +109,9 @@ export default { * @return {string} The formatted time */ formattedTime() { + if (!this.callTime) { + return '-- : --' + } let seconds = Math.floor((this.callTime / 1000) % 60) if (seconds < 10) { seconds = '0' + seconds @@ -117,15 +120,11 @@ export default { if (minutes < 10) { minutes = '0' + minutes } - let hours = Math.floor((this.callTime / (1000 * 60 * 60)) % 24) - if (hours < 10) { - hours = '0' + hours - } - if (hours === '00') { + const hours = Math.floor((this.callTime / (1000 * 60 * 60)) % 24) + if (hours === 0) { return minutes + ' : ' + seconds - } else { - return hours + ' : ' + minutes + ' : ' + seconds } + return hours + ' : ' + minutes + ' : ' + seconds }, isWide() { @@ -149,6 +148,9 @@ export default { }, computeElapsedTime() { + if (this.start === 0) { + return + } this.callTime = new Date() - this.callStart }, }, @@ -164,7 +166,7 @@ export default { height: var(--default-clickable-area); font-weight: bold; color: #fff; - width: 120px; + width: 116px; &__not-recording { padding-left: var(--default-clickable-area) !important