From c0586f71e3a543a92e6167cf775ac5ea60c15349 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 16 Mar 2023 17:46:44 -0700 Subject: [PATCH] Don't disconnect after oat reboot message Sort BLE devices alphabetically by name --- Meshtastic/Views/Bluetooth/Connect.swift | 2 +- Meshtastic/Views/Settings/Firmware.swift | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Meshtastic/Views/Bluetooth/Connect.swift b/Meshtastic/Views/Bluetooth/Connect.swift index 6fd4844c..32b25c29 100644 --- a/Meshtastic/Views/Bluetooth/Connect.swift +++ b/Meshtastic/Views/Bluetooth/Connect.swift @@ -160,7 +160,7 @@ struct Connect: View { if !self.bleManager.isConnected { Section(header: Text("available.radios").font(.title)) { - ForEach(bleManager.peripherals.filter({ $0.peripheral.state == CBPeripheralState.disconnected }).sorted(by: { $0.name > $1.name })) { peripheral in + ForEach(bleManager.peripherals.filter({ $0.peripheral.state == CBPeripheralState.disconnected }).sorted(by: { $0.name < $1.name })) { peripheral in HStack { if userSettings.preferredPeripheralId == peripheral.peripheral.identifier.uuidString { Image(systemName: "star.fill") diff --git a/Meshtastic/Views/Settings/Firmware.swift b/Meshtastic/Views/Settings/Firmware.swift index fa9965c4..54b692ce 100644 --- a/Meshtastic/Views/Settings/Firmware.swift +++ b/Meshtastic/Views/Settings/Firmware.swift @@ -78,9 +78,7 @@ struct Firmware: View { if connectedNode != nil { if !bleManager.sendRebootOta(fromUser: connectedNode!.user!, toUser: node!.user!, adminIndex: connectedNode!.myInfo!.adminIndex) { print("Reboot Failed") - } else { - bleManager.disconnectPeripheral(reconnect: false) - } + } } } label: { Label("Send Reboot OTA", systemImage: "square.and.arrow.down")