Aug 27 - Fixed inspection lost photos recovery

This commit is contained in:
Nguyen Ngo
2026-08-27 10:42:01 -04:00
parent ca7c09f982
commit 308710538b
14 changed files with 794 additions and 114 deletions
@@ -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)
}