Merge pull request #268 from meshtastic/fix-mbtiles-import

Add security call when importing mbtiles file
This commit is contained in:
Garth Vander Houwen 2022-12-14 09:26:15 -08:00 committed by GitHub
commit d5d0c51f12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -1,6 +1,6 @@
name: Feature Request
description: Request a new feature
title: "[Enhancement]: "
title: "[Feature Request]: "
labels: ["enhancement"]
body:
- type: markdown

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