Clear database when changeing device

This commit is contained in:
Garth Vander Houwen 2024-07-09 08:47:21 -07:00
parent 6ea2f244ba
commit 71d0ff535a
2 changed files with 2 additions and 2 deletions

View file

@ -221,12 +221,12 @@ struct Connect: View {
}
do {
try container.copyPersistentStores(to: url.appendingPathComponent("backup").appendingPathComponent("\(UserDefaults.preferredPeripheralNum)"), overwriting: true)
clearCoreDataDatabase(context: context, includeRoutes: true)
Logger.data.notice("🗂️ Made a core data backup to backup/\(UserDefaults.preferredPeripheralNum)")
} catch {
Logger.data.error("🗂️ Core data backup copy error: \(error, privacy: .public)")
}
clearCoreDataDatabase(context: context, includeRoutes: false)
}
UserDefaults.preferredPeripheralId = selectedPeripherialId
self.bleManager.connectTo(peripheral: peripheral.peripheral)

@ -1 +1 @@
Subproject commit 1198b7dbabf9768cb0143d2897707b4c7a51a5da
Subproject commit 0fd5023a0aa67eefdf2292a624e8fbbda4489a6c