Aug 27 - Fixed inspection lost photos recovery
This commit is contained in:
@@ -173,13 +173,13 @@ struct MyInspectionsView: View {
|
||||
private func deleteDraft(_ inspection: LocalInspection) {
|
||||
// Delete associated pending photos from disk and SwiftData
|
||||
for photo in inspection.pendingPhotos {
|
||||
try? FileManager.default.removeItem(atPath: photo.localFilePath)
|
||||
PhotoStore.remove(at: photo.localFilePath)
|
||||
context.delete(photo)
|
||||
}
|
||||
// Delete associated local issues
|
||||
for issue in inspection.localIssues {
|
||||
for path in issue.photoLocalPaths {
|
||||
try? FileManager.default.removeItem(atPath: path)
|
||||
PhotoStore.remove(at: path)
|
||||
}
|
||||
context.delete(issue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user