mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: Defer setting connected state until after nodeDB load (#4505)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
826bffe230
commit
7bcc51863f
2 changed files with 3 additions and 3 deletions
|
|
@ -85,8 +85,6 @@ constructor(
|
|||
} else {
|
||||
myNodeInfo = newMyNodeInfo
|
||||
Logger.i { "myNodeInfo committed successfully" }
|
||||
connectionStateHolder.setState(ConnectionState.Connected)
|
||||
serviceBroadcasts.broadcastConnection()
|
||||
connectionManager.onRadioConfigLoaded()
|
||||
}
|
||||
|
||||
|
|
@ -123,6 +121,8 @@ constructor(
|
|||
}
|
||||
nodeManager.isNodeDbReady.value = true
|
||||
nodeManager.allowNodeDbWrites.value = true
|
||||
connectionStateHolder.setState(ConnectionState.Connected)
|
||||
serviceBroadcasts.broadcastConnection()
|
||||
connectionManager.onNodeDbReady()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ constructor(
|
|||
}
|
||||
|
||||
private fun onConnectionChanged(c: ConnectionState) {
|
||||
if (connectionStateHolder.connectionState.value == c) return
|
||||
if (connectionStateHolder.connectionState.value == c && c !is ConnectionState.Connected) return
|
||||
Logger.d { "onConnectionChanged: ${connectionStateHolder.connectionState.value} -> $c" }
|
||||
|
||||
sleepTimeout?.cancel()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue