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
+2 -6
View File
@@ -28,12 +28,8 @@ export const useCallsStore = defineStore('calls', {
if (!TERMINAL_STATUSES.includes(status)) return;
const call = this.calls.find(c => c.callSid === callSid);
// For WhatsApp, the upload-and-cleanup must happen before the recorder
// state is wiped — that runs from the voice_call.ended cable handler.
// If we tear down here (race-winning the cable end-event), the recorder
// chunks are gone before they get uploaded, so the recording is lost.
// Just drop the call from the store; voice_call.ended will idempotently
// finish cleanup once it arrives.
// WhatsApp recordings live in the in-memory recorder until voice_call.ended
// uploads them; tearing down here would race-wipe those chunks.
if (call?.provider === 'whatsapp') {
this.calls = this.calls.filter(c => c.callSid !== callSid);
return;