mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Change UploadModel::createAndAddUploadItem to not duplicate new uploadItems of same UploadableFile (#5179)
This commit is contained in:
parent
be1946cd7b
commit
66e15a17ef
1 changed files with 7 additions and 0 deletions
|
|
@ -117,6 +117,13 @@ public class UploadModel {
|
|||
createdTimestampSource,
|
||||
uploadableFile.getContentUri(),
|
||||
fileCreatedDateString);
|
||||
|
||||
// If an uploadItem of the same uploadableFile has been created before, we return that.
|
||||
// This is to avoid multiple instances of uploadItem of same file passed around.
|
||||
if (items.contains(uploadItem)) {
|
||||
return items.get(items.indexOf(uploadItem));
|
||||
}
|
||||
|
||||
if (place != null) {
|
||||
uploadItem.getUploadMediaDetails().set(0, new UploadMediaDetail(place));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue