Fix - No Precise Error Message After Error Due to Password Change (#5643)

* initial commit

* Fix No Precise Message After Clicking Review Buttons

* Fix For ThanksClient

* Fix For Depictions

* Fix For Categories

* Fix For Description & Coordinates

* Fix For Description & Coordinates

* Fix For Description & Coordinates

* Fix For Mark as Read notifications

* resolve conflicts

* fix merge conflicts
This commit is contained in:
Shashank Kumar 2024-04-01 13:53:00 +05:30 committed by GitHub
parent e56de2c343
commit 3d1efecb55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 361 additions and 110 deletions

View file

@ -59,11 +59,6 @@ class WikiBaseClient @Inject constructor(
}
private fun csrfToken(): Observable<String> = Observable.fromCallable {
try {
csrfTokenClient.getTokenBlocking()
} catch (throwable: Throwable) {
Timber.e(throwable)
""
}
csrfTokenClient.getTokenBlocking()
}
}

View file

@ -8,6 +8,7 @@ import android.content.Context;
import androidx.annotation.Nullable;
import com.google.gson.Gson;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.auth.csrf.InvalidLoginTokenException;
import fr.free.nrw.commons.contributions.Contribution;
import fr.free.nrw.commons.kvstore.JsonKvStore;
import fr.free.nrw.commons.upload.UploadResult;
@ -123,8 +124,13 @@ public class WikidataEditService {
}
})
.doOnError(throwable -> {
Timber.e(throwable, "Error occurred while setting DEPICTS property");
ViewUtil.showLongToast(context, throwable.toString());
if (throwable instanceof InvalidLoginTokenException) {
Observable.error(throwable);
} else {
Timber.e(throwable, "Error occurred while setting DEPICTS property");
ViewUtil.showLongToast(context, throwable.toString());
}
})
.subscribeOn(Schedulers.io());
}