Add security call when importing mbtiles file

This commit is contained in:
Joshua Pirihi 2022-12-15 06:16:07 +13:00
parent f82bb2fc2d
commit 44a388f0c8

View file

@ -66,6 +66,12 @@ struct MeshtasticAppleApp: App {
let destination = documentsDirectory.appendingPathComponent("offline_map.mbtiles", isDirectory: false)
if !self.saveChannels {
//tell the system we want the file please
guard url.startAccessingSecurityScopedResource() else {
return
}
//do we need to delete an old one?
if (fileManager.fileExists(atPath: destination.path)) {
print(" Found an old map file. Deleting it")