From 75143ba07c97cb1d2b94681704e50fa090d0c9e7 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sat, 7 Feb 2026 15:40:08 -0600 Subject: [PATCH] feat(service): Preserve Connecting state on reconnect Keeps the connection state as 'Connecting' if it was not 'Disconnected' when `handleConnected` is called. This prevents the UI from briefly showing a disconnected state during a reconnection attempt, such as when the device is rebooting. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- .../com/geeksville/mesh/service/MeshConnectionManager.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshConnectionManager.kt b/app/src/main/java/com/geeksville/mesh/service/MeshConnectionManager.kt index 795276186..54cd877c0 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshConnectionManager.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshConnectionManager.kt @@ -134,7 +134,10 @@ constructor( } private fun handleConnected() { - connectionStateHolder.setState(ConnectionState.Connecting) + // The service state remains 'Connecting' until config is fully loaded + if (connectionStateHolder.connectionState.value == ConnectionState.Disconnected) { + connectionStateHolder.setState(ConnectionState.Connecting) + } serviceBroadcasts.broadcastConnection() Logger.d { "Starting connect" } connectTimeMsec = System.currentTimeMillis()