mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
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>
This commit is contained in:
parent
0bcc801bc4
commit
75143ba07c
1 changed files with 4 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue