Skip to content

Commit

Permalink
Fix-Peer Review Buttons not get disabled after voting an Image for de…
Browse files Browse the repository at this point in the history
…letion (commons-app#5519)

* Fix-Peer Review Buttons not get disabled after voting an Image for deletion

* Fix
  • Loading branch information
shashankiitbhu authored Mar 27, 2024
1 parent 4264164 commit 4c43bf2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ public void askReasonAndExecute(Media media,
});

alert.setPositiveButton(context.getString(R.string.ok), (dialogInterface, i) -> {
reviewCallback.disableButtons();


String reason = getLocalizedResources(context, Locale.ENGLISH).getString(R.string.delete_helper_ask_alert_set_positive_button_reason) + " ";

Expand All @@ -229,6 +231,7 @@ public void askReasonAndExecute(Media media,
} else {
reviewCallback.onFailure();
}
reviewCallback.enableButtons();
});

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,9 @@ public interface ReviewCallback {
void onSuccess();

void onFailure();

void disableButtons();

void enableButtons();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,24 @@ public void onSuccess() {
public void onFailure() {
//do nothing
}

/**
* This function is called when an image is being loaded
* to disable the review buttons
*/
@Override
public void disableButtons() {
ReviewImageFragment.this.disableButtons();
}

/**
* This function is called when an image has
* been loaded to enable the review buttons.
*/
@Override
public void enableButtons() {
ReviewImageFragment.this.enableButtons();
}
};
}

Expand Down

0 comments on commit 4c43bf2

Please sign in to comment.