mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
Fix crash(es) upon upload failure. (#2699)
* Fix crash(es) upon upload failure. * Further improve Rx structure.
This commit is contained in:
parent
a32ba452ec
commit
013e1a5430
3 changed files with 71 additions and 75 deletions
|
|
@ -944,7 +944,7 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
long dataLength,
|
||||
Uri fileUri,
|
||||
Uri contentProviderUri,
|
||||
ProgressListener progressListener) throws IOException {
|
||||
ProgressListener progressListener) {
|
||||
return Single.fromCallable(() -> {
|
||||
CustomApiResult result = api.uploadToStash(filename, file, dataLength, getEditToken(), progressListener::onProgress);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import java.io.InputStream;
|
|||
import java.util.List;
|
||||
|
||||
import fr.free.nrw.commons.Media;
|
||||
import fr.free.nrw.commons.campaigns.CampaignResponseDTO;
|
||||
import fr.free.nrw.commons.notification.Notification;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
|
|
@ -53,7 +52,7 @@ public interface MediaWikiApi {
|
|||
@NonNull
|
||||
Single<UploadStash> uploadFile(String filename, InputStream file,
|
||||
long dataLength, Uri fileUri, Uri contentProviderUri,
|
||||
final ProgressListener progressListener) throws IOException;
|
||||
final ProgressListener progressListener);
|
||||
|
||||
@NonNull
|
||||
Single<UploadResult> uploadFileFinalize(String filename, String filekey,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue