Skip to content

Commit

Permalink
Sync up isonline with the firmware add local stats extension
Browse files Browse the repository at this point in the history
  • Loading branch information
garthvh committed Aug 25, 2024
1 parent 4361a08 commit 25f8e42
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Meshtastic/Extensions/CoreData/NodeInfoEntityExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ extension NodeInfoEntity {
return self.telemetries?.filtered(using: NSPredicate(format: "metricsType == 1")).lastObject as? TelemetryEntity
}

var latestLocalStats: TelemetryEntity? {
return self.telemetries?.filtered(using: NSPredicate(format: "metricsType == 6")).lastObject as? TelemetryEntity
}

var hasPositions: Bool {
return positions?.count ?? 0 > 0
}
Expand Down
3 changes: 3 additions & 0 deletions Meshtastic/Views/Messages/UserList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ struct UserList: View {
.onChange(of: maxDistance) { _ in
searchUserList()
}
.onReceive(users.publisher) { _ in
searchUserList()
}
.onAppear {
searchUserList()
}
Expand Down
2 changes: 1 addition & 1 deletion Meshtastic/Views/Nodes/MeshMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct MeshMap: View {
guard case .map(let selectedNodeNum) = router.navigationState else { return }
// TODO: handle deep link for waypoints
}
.onChange(of: (selectedMapLayer)) { newMapLayer in
.onChange(of: selectedMapLayer) { newMapLayer in
switch selectedMapLayer {
case .standard:
UserDefaults.mapLayer = newMapLayer
Expand Down
5 changes: 5 additions & 0 deletions Meshtastic/Views/Nodes/NodeList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ struct NodeList: View {
self.selectedNode = nil
}
}
.onReceive(nodes.publisher) { _ in
Task {
await searchNodeList()
}
}
.onAppear {
Task {
await searchNodeList()
Expand Down

0 comments on commit 25f8e42

Please sign in to comment.