From 9112e5cde269bc67a90e994a8c43a16b059d809c Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 31 Jan 2023 22:59:43 -0800 Subject: [PATCH] Properly disable forms when there is not an associated config --- Meshtastic/Views/Settings/Config/BluetoothConfig.swift | 2 +- Meshtastic/Views/Settings/Config/DeviceConfig.swift | 2 +- Meshtastic/Views/Settings/Config/DisplayConfig.swift | 2 +- Meshtastic/Views/Settings/Config/NetworkConfig.swift | 2 +- Meshtastic/Views/Settings/Config/PositionConfig.swift | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Meshtastic/Views/Settings/Config/BluetoothConfig.swift b/Meshtastic/Views/Settings/Config/BluetoothConfig.swift index 1d2f5ec3..b05d2190 100644 --- a/Meshtastic/Views/Settings/Config/BluetoothConfig.swift +++ b/Meshtastic/Views/Settings/Config/BluetoothConfig.swift @@ -79,7 +79,7 @@ struct BluetoothConfig: View { } } } - .disabled(self.bleManager.connectedPeripheral == nil || node?.loRaConfig == nil) + .disabled(self.bleManager.connectedPeripheral == nil || node?.bluetoothConfig == nil) Button { isPresentingSaveConfirm = true diff --git a/Meshtastic/Views/Settings/Config/DeviceConfig.swift b/Meshtastic/Views/Settings/Config/DeviceConfig.swift index c58f9ce9..8023fb4f 100644 --- a/Meshtastic/Views/Settings/Config/DeviceConfig.swift +++ b/Meshtastic/Views/Settings/Config/DeviceConfig.swift @@ -85,7 +85,7 @@ struct DeviceConfig: View { } } - .disabled(self.bleManager.connectedPeripheral == nil || node?.loRaConfig == nil) + .disabled(self.bleManager.connectedPeripheral == nil || node?.deviceConfig == nil) HStack { diff --git a/Meshtastic/Views/Settings/Config/DisplayConfig.swift b/Meshtastic/Views/Settings/Config/DisplayConfig.swift index dc595819..cd589a4c 100644 --- a/Meshtastic/Views/Settings/Config/DisplayConfig.swift +++ b/Meshtastic/Views/Settings/Config/DisplayConfig.swift @@ -97,7 +97,7 @@ struct DisplayConfig: View { .listRowSeparator(.visible) } } - .disabled(self.bleManager.connectedPeripheral == nil || node?.loRaConfig == nil) + .disabled(self.bleManager.connectedPeripheral == nil || node?.displayConfig == nil) Button { diff --git a/Meshtastic/Views/Settings/Config/NetworkConfig.swift b/Meshtastic/Views/Settings/Config/NetworkConfig.swift index 26d8fa03..2fafc701 100644 --- a/Meshtastic/Views/Settings/Config/NetworkConfig.swift +++ b/Meshtastic/Views/Settings/Config/NetworkConfig.swift @@ -91,7 +91,7 @@ struct NetworkConfig: View { } } .scrollDismissesKeyboard(.interactively) - .disabled(!(node != nil)) + .disabled(self.bleManager.connectedPeripheral == nil || node?.networkConfig == nil) Button { isPresentingSaveConfirm = true } label: { diff --git a/Meshtastic/Views/Settings/Config/PositionConfig.swift b/Meshtastic/Views/Settings/Config/PositionConfig.swift index 4e2261a6..48301bdb 100644 --- a/Meshtastic/Views/Settings/Config/PositionConfig.swift +++ b/Meshtastic/Views/Settings/Config/PositionConfig.swift @@ -185,7 +185,7 @@ struct PositionConfig: View { } } } - .disabled(self.bleManager.connectedPeripheral == nil || node?.loRaConfig == nil) + .disabled(self.bleManager.connectedPeripheral == nil || node?.positionConfig == nil) Button { isPresentingSaveConfirm = true