mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Handle a few crashes
This commit is contained in:
parent
2144984ab7
commit
f7b45797a8
3 changed files with 6 additions and 6 deletions
|
|
@ -177,7 +177,7 @@ struct DeviceMetricsLog: View {
|
|||
isPresented: $isExporting,
|
||||
document: CsvDocument(emptyCsv: exportString),
|
||||
contentType: .commaSeparatedText,
|
||||
defaultFilename: String("\(node.user!.longName ?? "Node") \(NSLocalizedString("device.metrics.log", comment: "Device Metrics Log"))"),
|
||||
defaultFilename: String("\(node.user?.longName ?? "Node") \(NSLocalizedString("device.metrics.log", comment: "Device Metrics Log"))"),
|
||||
onCompletion: { result in
|
||||
if case .success = result {
|
||||
print("Device metrics log download succeeded.")
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ struct BluetoothConfig: View {
|
|||
self.hasChanges = false
|
||||
|
||||
// Need to request a BluetoothConfig from the remote node before allowing changes
|
||||
if bleManager.connectedPeripheral != nil && node?.loRaConfig == nil {
|
||||
if bleManager.connectedPeripheral != nil && node?.bluetoothConfig == nil {
|
||||
print("empty bluetooth config")
|
||||
let connectedNode = getNodeInfo(id: bleManager.connectedPeripheral.num, context: context)
|
||||
if connectedNode.id > 0 {
|
||||
|
|
|
|||
|
|
@ -123,17 +123,17 @@ struct TelemetryConfig: View {
|
|||
}
|
||||
}
|
||||
.onChange(of: deviceUpdateInterval) { newDeviceInterval in
|
||||
if node != nil && node!.telemetryConfig != nil {
|
||||
if node != nil && node?.telemetryConfig != nil {
|
||||
if newDeviceInterval != node!.telemetryConfig!.deviceUpdateInterval { hasChanges = true }
|
||||
}
|
||||
}
|
||||
.onChange(of: environmentUpdateInterval) { newEnvInterval in
|
||||
if node != nil && node!.telemetryConfig != nil {
|
||||
if node != nil && node?.telemetryConfig != nil {
|
||||
if newEnvInterval != node!.telemetryConfig!.environmentUpdateInterval { hasChanges = true }
|
||||
}
|
||||
}
|
||||
.onChange(of: environmentMeasurementEnabled) { newEnvEnabled in
|
||||
if node != nil && node!.telemetryConfig != nil {
|
||||
if node != nil && node?.telemetryConfig != nil {
|
||||
if newEnvEnabled != node!.telemetryConfig!.environmentMeasurementEnabled { hasChanges = true }
|
||||
}
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ struct TelemetryConfig: View {
|
|||
}
|
||||
}
|
||||
.onChange(of: environmentDisplayFahrenheit) { newEnvDisplayF in
|
||||
if node != nil && node!.telemetryConfig != nil {
|
||||
if node != nil && node?.telemetryConfig != nil {
|
||||
if newEnvDisplayF != node!.telemetryConfig!.environmentDisplayFahrenheit { hasChanges = true }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue