mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
FilePicker: Fix error when multiple images are returned from Documents based picker (#6033)
* FilePicker: Correctly handle Documents result * Empty commit to re-trigger CI checks
This commit is contained in:
parent
a933b92efa
commit
e8970ab7f2
1 changed files with 2 additions and 11 deletions
|
|
@ -263,17 +263,8 @@ object FilePicker : Constants {
|
|||
) {
|
||||
if (result.resultCode == Activity.RESULT_OK && !isPhoto(result.data)) {
|
||||
try {
|
||||
val photoPath = result.data?.data
|
||||
val photoFile = PickedFiles.pickedExistingPicture(activity, photoPath!!)
|
||||
callbacks.onImagesPicked(
|
||||
singleFileList(photoFile),
|
||||
ImageSource.DOCUMENTS,
|
||||
restoreType(activity)
|
||||
)
|
||||
|
||||
if (configuration(activity).shouldCopyPickedImagesToPublicGalleryAppFolder()) {
|
||||
PickedFiles.copyFilesInSeparateThread(activity, singleFileList(photoFile))
|
||||
}
|
||||
val files = getFilesFromGalleryPictures(result.data, activity)
|
||||
callbacks.onImagesPicked(files, ImageSource.DOCUMENTS, restoreType(activity))
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
callbacks.onImagePickerError(e, ImageSource.DOCUMENTS, restoreType(activity))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue