mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: implement repository pattern for NodeDB (#835)
- enforce Unidirectional Data Flow removing nodeDB updates via `MainActivity`/`UIState` - merge `MyNodeInfoDao` into `NodeInfoDao` - move node list re-indexing to database
This commit is contained in:
parent
3f0dfb7690
commit
c8f93db00d
10 changed files with 170 additions and 147 deletions
|
|
@ -340,8 +340,6 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
else {
|
||||
// If our app is too old/new, we probably don't understand the new DeviceConfig messages, so we don't read them until here
|
||||
|
||||
model.updateNodesFromDevice()
|
||||
|
||||
// we have a connection to our device now, do the channel change
|
||||
perhapsChangeChannel()
|
||||
}
|
||||
|
|
@ -453,11 +451,6 @@ class MainActivity : AppCompatActivity(), Logging {
|
|||
val connectionState =
|
||||
MeshService.ConnectionState.valueOf(service.connectionState())
|
||||
|
||||
// if we are not connected, onMeshConnectionChange won't fetch nodes from the service
|
||||
// in that case, we do it here - because the service certainly has a better idea of node db that we have
|
||||
if (connectionState != MeshService.ConnectionState.CONNECTED)
|
||||
model.updateNodesFromDevice()
|
||||
|
||||
// We won't receive a notify for the initial state of connection, so we force an update here
|
||||
onMeshConnectionChanged(connectionState)
|
||||
} catch (ex: RemoteException) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue