chore(voice): trim dead exports, fix duplicate-OR bug, drop redundant comments

Branch review pass:
- useWhatsappCallSession: drop unused `error` ref and unused exports
  (hasActiveWhatsappCall, isWhatsappCallMuted), fold sendWhatsappCallBeacon
  into a private beaconTerminate helper since only sendWhatsappTerminateBeacon
  consumed it externally. Trim WHAT-comments; keep WHY-comments
  (browser-quirk explanations, race-condition notes, auth-cookie rationale).
- VoiceCall.vue bubble: fix `data || data` short-circuit that did nothing —
  upstream key transform was the same on both branches; collapse to one read.
- calls/useCallSession/actionCable/FloatingCallWidget/VoiceCallButton:
  drop comments that just describe what the next line already says.

Net diff: -63 lines across 7 files. No behavior change.
This commit is contained in:
Tanmay Deep Sharma
2026-05-04 15:16:04 +07:00
parent 6179adac22
commit 0b1ad1a854
7 changed files with 88 additions and 151 deletions
@@ -43,15 +43,14 @@ const audioAttachment = computed(() =>
(attachments?.value || []).find(a => a.fileType === 'audio')
);
// Duration lives in two places depending on which payload the FE got:
// - call.duration_seconds / call.durationSeconds (push_event_data shape)
// - content_attributes.data.duration_seconds (message-side mirror)
// Both can be camelCased by useTransformKeys upstream — check every variant.
// Duration may arrive on call.duration_seconds (push_event_data) or
// content_attributes.data.duration_seconds — and either may be camelCased
// upstream, so check every variant.
const durationSeconds = computed(() => {
const fromCall = call.value?.durationSeconds || call.value?.duration_seconds;
if (fromCall != null) return fromCall;
const data = contentAttributes?.value?.data || contentAttributes?.value?.data;
const data = contentAttributes?.value?.data;
return data?.durationSeconds || data?.duration_seconds;
});
@@ -118,8 +117,6 @@ const bgColor = computed(() => BG_COLOR_MAP[status.value] || 'bg-n-teal-9');
{{ $t(labelKey) }}
</span>
<span class="text-xs text-n-slate-11">
<!-- When the audio chip is rendered it already shows duration in
its own player; suppress here to avoid two competing numbers. -->
{{
audioAttachment
? $t(subtextKey)