mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Clean up node list and details views
This commit is contained in:
parent
f5463e3633
commit
9a17b65abe
3 changed files with 26 additions and 24 deletions
|
|
@ -114,7 +114,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
if centralManager.isScanning {
|
||||
|
||||
self.centralManager.stopScan()
|
||||
// self.isScanning = self.centralManager.isScanning
|
||||
isScanning = self.centralManager.isScanning
|
||||
print("🛑 Stopped Scanning")
|
||||
}
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
self.disconnectPeripheral()
|
||||
}
|
||||
|
||||
//self.connectedVersion = "0.0.0"
|
||||
self.connectedVersion = "0.0.0"
|
||||
self.centralManager?.connect(peripheral)
|
||||
|
||||
// Invalidate any existing timer
|
||||
|
|
@ -223,7 +223,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
}
|
||||
|
||||
let today = Date()
|
||||
let visibleDuration = Calendar.current.date(byAdding: .second, value: -4, to: today)!
|
||||
let visibleDuration = Calendar.current.date(byAdding: .second, value: -2, to: today)!
|
||||
peripherals.removeAll(where: { $0.lastUpdate <= visibleDuration})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ struct LocationHistory: View {
|
|||
|
||||
var body: some View {
|
||||
|
||||
VStack {
|
||||
|
||||
NavigationStack {
|
||||
|
||||
List {
|
||||
|
||||
ForEach(node.positions!.reversed() as! [PositionEntity], id: \.self) { (mappin: PositionEntity) in
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ struct NodeDetail: View {
|
|||
}
|
||||
)
|
||||
}
|
||||
.ignoresSafeArea(.all, edges: [.leading, .trailing])
|
||||
.frame(idealWidth: bounds.size.width, minHeight: bounds.size.height / 2)
|
||||
.ignoresSafeArea(.all, edges: [.leading, .trailing])
|
||||
.frame(idealWidth: bounds.size.width, minHeight: bounds.size.height / 1.70)
|
||||
}
|
||||
}
|
||||
Text("Sats: \(mostRecent.satsInView)").offset( y:-40)
|
||||
|
|
@ -440,28 +440,30 @@ struct NodeDetail: View {
|
|||
}
|
||||
}
|
||||
.offset( y:-40)
|
||||
.padding(.bottom, -40)
|
||||
}
|
||||
.edgesIgnoringSafeArea([.leading, .trailing])
|
||||
}
|
||||
}
|
||||
.navigationTitle((node.user != nil) ? String(node.user!.longName ?? "Unknown") : "Unknown")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarItems(trailing:
|
||||
.navigationTitle((node.user != nil) ? String(node.user!.longName ?? "Unknown") : "Unknown")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.padding(.bottom, 10)
|
||||
.navigationBarItems(trailing:
|
||||
|
||||
ZStack {
|
||||
ZStack {
|
||||
|
||||
ConnectedDevice(
|
||||
bluetoothOn: bleManager.isSwitchedOn,
|
||||
deviceConnected: bleManager.connectedPeripheral != nil,
|
||||
name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????")
|
||||
}
|
||||
)
|
||||
.onAppear {
|
||||
ConnectedDevice(
|
||||
bluetoothOn: bleManager.isSwitchedOn,
|
||||
deviceConnected: bleManager.connectedPeripheral != nil,
|
||||
name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????")
|
||||
}
|
||||
)
|
||||
.onAppear {
|
||||
|
||||
if self.initialLoad{
|
||||
|
||||
self.bleManager.context = context
|
||||
self.initialLoad = false
|
||||
if self.initialLoad{
|
||||
|
||||
self.bleManager.context = context
|
||||
self.initialLoad = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue