mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Don't report an empty media selection as a successful pick
Both PhotoLibraryPicker and DocumentPicker reported failures via .error but still emitted .selectedMediaAtURLs([]) when every selected item failed to load or export (e.g. an iCloud photo that isn't downloaded, or a document that fails the security-scoped temp copy) - an empty "success" that consumers had to defend against. Skip that emission in both, and report .error for PhotoLibraryPicker's previously silent missing-content-type case so the user gets feedback.
This commit is contained in:
@@ -90,6 +90,11 @@ struct DocumentPicker: UIViewControllerRepresentable {
|
||||
}
|
||||
}
|
||||
|
||||
guard !selectedURLs.isEmpty else {
|
||||
// Every picked document failed to copy; each failure was already surfaced via .error.
|
||||
return
|
||||
}
|
||||
|
||||
documentPicker.callback(.selectedMediaAtURLs(selectedURLs))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user