mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
fix: remove if-condition to prevent hiding top card and refactor code
This commit is contained in:
parent
566a3c6ee3
commit
e15d8b156d
1 changed files with 22 additions and 25 deletions
|
|
@ -146,11 +146,7 @@ class UploadPresenter @Inject internal constructor(
|
|||
|
||||
override fun deletePictureAtIndex(index: Int) {
|
||||
val uploadableFiles = view.getUploadableFiles()
|
||||
if (index == uploadableFiles!!.size - 1) {
|
||||
// If the next fragment to be shown is not one of the MediaDetailsFragment
|
||||
// lets hide the top card so that it doesn't appear on the other fragments
|
||||
view.showHideTopCard(false)
|
||||
}
|
||||
uploadableFiles?.let {
|
||||
view.setImageCancelled(true)
|
||||
repository.deletePicture(uploadableFiles[index].getFilePath())
|
||||
if (uploadableFiles.size == 1) {
|
||||
|
|
@ -175,6 +171,7 @@ class UploadPresenter @Inject internal constructor(
|
|||
//In case lets update the number of uploadable media
|
||||
view.updateTopCardTitle()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachView(view: UploadContract.View) {
|
||||
this.view = view
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue