From c095f2d83eab39aff5d7989a324368551a1634d4 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 7 Oct 2022 15:57:57 -0700 Subject: [PATCH] Make things a little more readable --- Meshtastic/MeshtasticApp.swift | 1 - .../Views/Settings/Config/DeviceConfig.swift | 15 ++++++++------- Meshtastic/Views/Settings/ShareChannels.swift | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Meshtastic/MeshtasticApp.swift b/Meshtastic/MeshtasticApp.swift index 5647e05b..89139e34 100644 --- a/Meshtastic/MeshtasticApp.swift +++ b/Meshtastic/MeshtasticApp.swift @@ -50,7 +50,6 @@ struct MeshtasticAppleApp: App { } else { print("User wants to import a MBTILES offline map file: \(channelUrl?.absoluteString ?? "No Tiles link")") } - //we are expecting a .mbtiles map file that contains raster data //save it to the documents directory, and name it offline_map.mbtiles diff --git a/Meshtastic/Views/Settings/Config/DeviceConfig.swift b/Meshtastic/Views/Settings/Config/DeviceConfig.swift index 913f58db..241f828c 100644 --- a/Meshtastic/Views/Settings/Config/DeviceConfig.swift +++ b/Meshtastic/Views/Settings/Config/DeviceConfig.swift @@ -75,11 +75,11 @@ struct DeviceConfig: View { titleVisibility: .visible ) { Button("Erase all device and app data?", role: .destructive) { - if !bleManager.sendNodeDBReset(destNum: bleManager.connectedPeripheral.num) { - print("NodeDB Reset Failed") - } else { - bleManager.disconnectPeripheral() + if bleManager.sendNodeDBReset(destNum: bleManager.connectedPeripheral.num) { + bleManager.disconnectPeripheral() clearCoreDataDatabase(context: context) + } else { + print("NodeDB Reset Failed") } } } @@ -98,11 +98,12 @@ struct DeviceConfig: View { ) { Button("Factory reset your device and app? ", role: .destructive) { - if !bleManager.sendFactoryReset(destNum: bleManager.connectedPeripheral.num) { - print("Factory Reset Failed") - } else { + if bleManager.sendFactoryReset(destNum: bleManager.connectedPeripheral.num) { bleManager.disconnectPeripheral() clearCoreDataDatabase(context: context) + } else { + print("Factory Reset Failed") + } } } diff --git a/Meshtastic/Views/Settings/ShareChannels.swift b/Meshtastic/Views/Settings/ShareChannels.swift index ea89cb6d..9d097326 100644 --- a/Meshtastic/Views/Settings/ShareChannels.swift +++ b/Meshtastic/Views/Settings/ShareChannels.swift @@ -146,7 +146,7 @@ struct ShareChannels: View { preview: SharePreview("Meshtastic Node \(node?.user?.shortName ?? "????") has shared channels with you", image: Image(uiImage: qrImage)) ) - .presentationDetents([.large, .large]) + .presentationDetents([.medium, .large]) Divider()