mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Fix image not loading issue in peer review (#2902)
* Fix image loading issue in peer review * With more test cases
This commit is contained in:
parent
482cad6663
commit
accb880256
2 changed files with 20 additions and 4 deletions
|
|
@ -46,10 +46,10 @@ public class ReviewHelper {
|
|||
.flatMap(title -> mediaWikiApi.pageExists("Commons:Deletion_requests/" + title)
|
||||
.map(pageExists -> new Pair<>(title, pageExists)))
|
||||
.map((Pair<String, Boolean> pair) -> {
|
||||
if (pair.second) {
|
||||
if (!pair.second) {
|
||||
return new Media(pair.first.replace("File:", ""));
|
||||
}
|
||||
throw new Exception("Page does not exist");
|
||||
throw new Exception("Already nominated for deletion");
|
||||
}).retry(MAX_RANDOM_TRIES);
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ public class ReviewHelper {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public String findImageInRecentChanges(List<RecentChange> recentChanges) {
|
||||
private String findImageInRecentChanges(List<RecentChange> recentChanges) {
|
||||
String imageTitle;
|
||||
Random r = new Random();
|
||||
int count = recentChanges.size();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue