mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-27 22:18:36 +00:00
android keep connection time correct wiith adding reconnecting
This commit is contained in:
+4
-1
@@ -174,7 +174,10 @@ actual fun ActiveCallView() {
|
||||
try {
|
||||
val callStatus = json.decodeFromString<WebRTCCallStatus>("\"${r.state.connectionState}\"")
|
||||
if (callStatus == WebRTCCallStatus.Connected) {
|
||||
updateActiveCall(call) { it.copy(callState = CallState.Connected, connectedAt = Clock.System.now()) }
|
||||
// Makes sure it uses the connected value so if call reconnects it doesn't use the reconnecting value
|
||||
updateActiveCall(call) { it.copy(callState = CallState.Connected, connectedAt = it.connectedAt ?: Clock.System.now()) }
|
||||
} else if (callStatus == WebRTCCallStatus.Reconnecting) {
|
||||
updateActiveCall(call) { it.copy(callState = CallState.Reconnecting) }
|
||||
}
|
||||
withBGApi { chatModel.controller.apiCallStatus(callRh, call.contact, callStatus) }
|
||||
} catch (e: Throwable) {
|
||||
|
||||
Reference in New Issue
Block a user