mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-23 08:12:44 -04:00
We shouldn't ask for myId until _after_ we have the nodedb (we need it)
This commit is contained in:
@@ -446,9 +446,6 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||
model.radioConfig.value =
|
||||
MeshProtos.RadioConfig.parseFrom(model.meshService!!.radioConfig)
|
||||
|
||||
// Pull down our real node ID
|
||||
model.nodeDB.myId.value = service.myId
|
||||
|
||||
// Update our nodeinfos based on data from the device
|
||||
val nodes = service.nodes.map {
|
||||
it.user?.id!! to it
|
||||
@@ -456,6 +453,9 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||
|
||||
model.nodeDB.nodes.value = nodes
|
||||
|
||||
// Pull down our real node ID - This must be done AFTER reading the nodedb because we need the DB to find our nodeinof object
|
||||
model.nodeDB.myId.value = service.myId
|
||||
|
||||
// we have a connection to our device now, do the channel change
|
||||
perhapsChangeChannel()
|
||||
}
|
||||
@@ -592,9 +592,11 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||
// If we have received the service, and hence registered with
|
||||
// it, then now is the time to unregister.
|
||||
// if we never connected, do nothing
|
||||
debug("Unbinding from mesh service!")
|
||||
mesh.close()
|
||||
model.meshService = null
|
||||
mesh?.let {
|
||||
debug("Unbinding from mesh service!")
|
||||
it.close()
|
||||
model.meshService = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
|
||||
Reference in New Issue
Block a user