From 111dbec0cb4dbdb56eddf8cc772a9a5b717ec219 Mon Sep 17 00:00:00 2001 From: GuavaGoat <320862384+GuavaGoat@users.noreply.github.com> Date: Tue, 25 Aug 2026 06:02:11 +0000 Subject: [PATCH] add reconnecting and make sure call duration is correct --- apps/ios/Shared/Views/Call/ActiveCallView.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/ios/Shared/Views/Call/ActiveCallView.swift b/apps/ios/Shared/Views/Call/ActiveCallView.swift index 754bcb2715..2478b30fd9 100644 --- a/apps/ios/Shared/Views/Call/ActiveCallView.swift +++ b/apps/ios/Shared/Views/Call/ActiveCallView.swift @@ -176,11 +176,18 @@ struct ActiveCallView: View { ? CallController.shared.reportOutgoingCall(call: call, connectedAt: nil) : CallController.shared.reportIncomingCall(call: call, connectedAt: nil) call.callState = .connected - call.connectedAt = .now + // connectedAt is only set once, so that the call duration is not reset + // when the call is reconnected after any connectivity issue like using cellular data and travelling + if call.connectedAt == nil { + call.connectedAt = .now + } if !wasConnected { CallSoundsPlayer.shared.vibrate(long: false) wasConnected = true } + } else if let callStatus = WebRTCCallStatus.init(rawValue: state.connectionState), + case .reconnecting = callStatus { + call.callState = .reconnecting } if state.connectionState == "closed" { closeCallView(client)