From 38fa4c231f15b53ef2643bf485539ac72841cf76 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:05:13 +0400 Subject: [PATCH] ui: improve remote controller stop reason (#4670) --- apps/ios/Shared/Model/SimpleXAPI.swift | 2 ++ .../commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/ios/Shared/Model/SimpleXAPI.swift b/apps/ios/Shared/Model/SimpleXAPI.swift index 5707620502..1f6edaf720 100644 --- a/apps/ios/Shared/Model/SimpleXAPI.swift +++ b/apps/ios/Shared/Model/SimpleXAPI.swift @@ -2086,6 +2086,8 @@ func processReceivedMsg(_ res: ChatResponse) async { m.remoteCtrlSession = nil dismissAllSheets() { switch rcStopReason { + case .disconnected: + () case .connectionFailed(.errorAgent(.RCP(.identity))): AlertManager.shared.showAlertMsg( title: "Connection with desktop stopped", diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt index 8bf93d0407..fe568b5144 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt @@ -2523,6 +2523,8 @@ object ChatController { ModalManager.fullscreen.closeModals() fun showAlert(chatError: ChatError) { when { + r.rcStopReason is RemoteCtrlStopReason.Disconnected -> + {} r.rcStopReason is RemoteCtrlStopReason.ConnectionFailed && r.rcStopReason.chatError is ChatError.ChatErrorAgent && r.rcStopReason.chatError.agentError is AgentErrorType.RCP