From b3bf9842e0b452bf462cd25f5e0be0ea0e66a7b4 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 8 Sep 2025 11:07:13 +0100 Subject: [PATCH] android, desktop: show alert when server test fails (#6251) --- .../views/usersettings/networkAndServers/NewServerView.kt | 7 +++++++ .../usersettings/networkAndServers/ProtocolServerView.kt | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NewServerView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NewServerView.kt index 1ec2534ab1..6a999aa89d 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NewServerView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/NewServerView.kt @@ -43,6 +43,13 @@ fun ModalData.NewServerView( if (isActive) { newServer.value = res.first testing.value = false + val failure = res.second + if (failure != null) { + AlertManager.shared.showAlertMsg( + title = generalGetString(MR.strings.smp_servers_test_failed), + text = failure.localizedDescription + ) + } } } }, diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/ProtocolServerView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/ProtocolServerView.kt index 8626fd3143..ccad962313 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/ProtocolServerView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/usersettings/networkAndServers/ProtocolServerView.kt @@ -93,6 +93,13 @@ fun ProtocolServerView( if (isActive) { draftServer.value = res.first testing.value = false + val failure = res.second + if (failure != null) { + AlertManager.shared.showAlertMsg( + title = generalGetString(MR.strings.smp_servers_test_failed), + text = failure.localizedDescription + ) + } } } },