diff --git a/Meshtastic/Views/Helpers/ConnectedDevice.swift b/Meshtastic/Views/Helpers/ConnectedDevice.swift index 3a3b6d2a..7e9d1852 100644 --- a/Meshtastic/Views/Helpers/ConnectedDevice.swift +++ b/Meshtastic/Views/Helpers/ConnectedDevice.swift @@ -9,6 +9,7 @@ struct ConnectedDevice: View { var bluetoothOn: Bool var deviceConnected: Bool var name: String + var mqttProxyEnabled: Bool = false var mqttProxyConnected: Bool = false var phoneOnly: Bool = false @@ -18,11 +19,11 @@ struct ConnectedDevice: View { if (phoneOnly && UIDevice.current.userInterfaceIdiom == .phone) || !phoneOnly { if bluetoothOn { - if deviceConnected && mqttProxyConnected { - if mqttProxyConnected { + if deviceConnected && (mqttProxyEnabled || mqttProxyConnected) { + if (mqttProxyConnected || mqttProxyEnabled) { Image(systemName: "iphone.gen3.radiowaves.left.and.right.circle.fill") .imageScale(.large) - .foregroundColor(.green) + .foregroundColor(mqttProxyConnected ? .green : .gray) .symbolRenderingMode(.hierarchical) } } diff --git a/Meshtastic/Views/Messages/ChannelMessageList.swift b/Meshtastic/Views/Messages/ChannelMessageList.swift index 22438b6c..234d705a 100644 --- a/Meshtastic/Views/Messages/ChannelMessageList.swift +++ b/Meshtastic/Views/Messages/ChannelMessageList.swift @@ -156,7 +156,10 @@ struct ChannelMessageList: View { ConnectedDevice( bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, - name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?") + name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?", + mqttProxyEnabled: channel.uplinkEnabled || channel.downlinkEnabled, + mqttProxyConnected: channel.uplinkEnabled || channel.downlinkEnabled ? bleManager.mqttProxyConnected : false + ) } } } diff --git a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift index be067293..b0de0cbb 100644 --- a/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift @@ -289,7 +289,7 @@ struct MQTTConfig: View { .navigationTitle("mqtt.config") .navigationBarItems(trailing: ZStack { - ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?", mqttProxyConnected: bleManager.mqttProxyConnected) + ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?", mqttProxyEnabled: self.enabled, mqttProxyConnected: bleManager.mqttProxyConnected) }) .onChange(of: address) { newAddress in if node != nil && node?.mqttConfig != nil {