From 219db29f3d0504a63560f2282455d70114a0a0af Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 6 Oct 2022 12:14:37 -0700 Subject: [PATCH] Clear database after disconnecting device --- Meshtastic/Views/Settings/Config/DeviceConfig.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Meshtastic/Views/Settings/Config/DeviceConfig.swift b/Meshtastic/Views/Settings/Config/DeviceConfig.swift index 2c39d4d9..913f58db 100644 --- a/Meshtastic/Views/Settings/Config/DeviceConfig.swift +++ b/Meshtastic/Views/Settings/Config/DeviceConfig.swift @@ -78,7 +78,6 @@ struct DeviceConfig: View { if !bleManager.sendNodeDBReset(destNum: bleManager.connectedPeripheral.num) { print("NodeDB Reset Failed") } else { - // Disconnect from device as we are going to wipe the app database now bleManager.disconnectPeripheral() clearCoreDataDatabase(context: context) } @@ -100,13 +99,10 @@ struct DeviceConfig: View { Button("Factory reset your device and app? ", role: .destructive) { if !bleManager.sendFactoryReset(destNum: bleManager.connectedPeripheral.num) { - print("Factory Reset Failed") } else { - clearCoreDataDatabase(context: context) - // Disconnect from device bleManager.disconnectPeripheral() - + clearCoreDataDatabase(context: context) } } }