mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +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)) {
|
if (result.resultCode == Activity.RESULT_OK && !isPhoto(result.data)) {
|
||||||
try {
|
try {
|
||||||
val photoPath = result.data?.data
|
val files = getFilesFromGalleryPictures(result.data, activity)
|
||||||
val photoFile = PickedFiles.pickedExistingPicture(activity, photoPath!!)
|
callbacks.onImagesPicked(files, ImageSource.DOCUMENTS, restoreType(activity))
|
||||||
callbacks.onImagesPicked(
|
|
||||||
singleFileList(photoFile),
|
|
||||||
ImageSource.DOCUMENTS,
|
|
||||||
restoreType(activity)
|
|
||||||
)
|
|
||||||
|
|
||||||
if (configuration(activity).shouldCopyPickedImagesToPublicGalleryAppFolder()) {
|
|
||||||
PickedFiles.copyFilesInSeparateThread(activity, singleFileList(photoFile))
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
callbacks.onImagePickerError(e, ImageSource.DOCUMENTS, restoreType(activity))
|
callbacks.onImagePickerError(e, ImageSource.DOCUMENTS, restoreType(activity))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue