mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
Todo for user (#3851)
* Add a simple message * Categories are edited * Display categories * read whole page * Revert wrong changes * Add newly added category field * Doesnt displaey alreasy added categories * add strings for notifications * clean code * Readd accidentally removed imports * Fix edit layout style * Fix category update messages * Pass isWikipediaButtonDisplayed information to fragment * Remove unused class * Fix strings * Fix string * Add exeption for uncategorised images too * Revert project.xml changes * fix update buttonvisibility issue * Make sure it works for auto added categories too * make the button visible * Make the button appear when categories are entered * Include cancel button * Make view updated too * Make category view edited * Update categories in an hacky way * Fix unnecessary method call * Add notes for short term fix to display added category * Fix tests * Fix strings * Fix click issue
This commit is contained in:
parent
f5e28834fc
commit
1856196851
20 changed files with 799 additions and 36 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package fr.free.nrw.commons.actions;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import org.wikipedia.csrf.CsrfTokenClient;
|
||||
import org.wikipedia.dataclient.Service;
|
||||
|
||||
|
|
@ -48,12 +50,16 @@ public class PageEditClient {
|
|||
* @param summary Edit summary
|
||||
*/
|
||||
public Observable<Boolean> appendEdit(String pageTitle, String appendText, String summary) {
|
||||
try {
|
||||
return pageEditInterface.postAppendEdit(pageTitle, summary, appendText, csrfTokenClient.getTokenBlocking())
|
||||
.map(editResponse -> editResponse.edit().editSucceeded());
|
||||
} catch (Throwable throwable) {
|
||||
return Observable.just(false);
|
||||
}
|
||||
return Single.create((SingleOnSubscribe<String>) emitter -> {
|
||||
try {
|
||||
emitter.onSuccess(csrfTokenClient.getTokenBlocking());
|
||||
} catch (Throwable throwable) {
|
||||
emitter.onError(throwable);
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}).flatMapObservable(token -> pageEditInterface.postAppendEdit(pageTitle, summary, appendText, token)
|
||||
.map(editResponse -> editResponse.edit().editSucceeded()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue