Don't disconnect after oat reboot message

Sort BLE devices alphabetically by name
This commit is contained in:
Garth Vander Houwen 2023-03-16 17:46:44 -07:00
parent b747634d4e
commit c0586f71e3
2 changed files with 2 additions and 4 deletions

View file

@ -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")

View file

@ -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")