From bf94ceebbb9cc0fc9bdf27d8a59bba832713b505 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Thu, 1 Jan 2026 20:17:56 -0600 Subject: [PATCH] feat(call): implement elapsed time display for active calls and improve UI responsiveness with updated button styles --- .../frontend/components/call/CallOverlay.vue | 48 +++++++++++++++---- .../src/frontend/components/call/CallPage.vue | 34 ++++++++++--- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/meshchatx/src/frontend/components/call/CallOverlay.vue b/meshchatx/src/frontend/components/call/CallOverlay.vue index 3bb3312..fcb1f9d 100644 --- a/meshchatx/src/frontend/components/call/CallOverlay.vue +++ b/meshchatx/src/frontend/components/call/CallOverlay.vue @@ -1,8 +1,8 @@ +
+ {{ elapsedTime }} +
@@ -209,16 +215,16 @@
-
+
@@ -227,10 +233,10 @@ v-if="activeCall.is_incoming && activeCall.status === 4" :title="$t('call.send_to_voicemail')" type="button" - class="inline-flex items-center gap-x-2 rounded-2xl bg-blue-600 px-6 py-4 text-lg font-bold text-white shadow-xl hover:bg-blue-500 transition-all duration-200" + class="inline-flex items-center gap-x-2 rounded-2xl bg-blue-600 px-5 py-3 text-base font-bold text-white shadow-xl hover:bg-blue-500 transition-all duration-200" @click="sendToVoicemail" > - + {{ $t("call.send_to_voicemail") }} @@ -242,10 +248,10 @@ : $t('call.hangup_call') " type="button" - class="inline-flex items-center gap-x-2 rounded-2xl bg-red-600 px-6 py-4 text-lg font-bold text-white shadow-xl hover:bg-red-500 transition-all duration-200" + class="inline-flex items-center gap-x-2 rounded-2xl bg-red-600 px-5 py-3 text-base font-bold text-white shadow-xl hover:bg-red-500 transition-all duration-200" @click="hangupCall" > - + {{ activeCall.is_incoming && activeCall.status === 4 ? $t("call.decline") @@ -926,6 +932,7 @@ export default { ringtones: [], editingRingtoneId: null, editingRingtoneName: "", + elapsedTimeInterval: null, }; }, computed: { @@ -935,6 +942,13 @@ export default { isSpeakerMuted() { return this.activeCall?.is_speaker_muted ?? false; }, + elapsedTime() { + if (!this.activeCall?.call_start_time) { + return null; + } + const elapsed = Math.floor(Date.now() / 1000 - this.activeCall.call_start_time); + return Utils.formatMinutesSeconds(elapsed); + }, }, mounted() { this.getConfig(); @@ -959,6 +973,11 @@ export default { this.getVoicemails(); }, 10000); + // update elapsed time every second + this.elapsedTimeInterval = setInterval(() => { + this.$forceUpdate(); + }, 1000); + // autofill destination hash from query string const urlParams = new URLSearchParams(window.location.search); const destinationHash = urlParams.get("destination_hash"); @@ -969,6 +988,7 @@ export default { beforeUnmount() { if (this.statusInterval) clearInterval(this.statusInterval); if (this.historyInterval) clearInterval(this.historyInterval); + if (this.elapsedTimeInterval) clearInterval(this.elapsedTimeInterval); if (this.endedTimeout) clearTimeout(this.endedTimeout); if (this.audioPlayer) { this.audioPlayer.pause();