Fixes bug where "The upload failed." error message shows up when media upload is canceled intentionally.
This commit is contained in:
parent
b06dda47c1
commit
932a990fe4
1 changed files with 6 additions and 3 deletions
|
@ -1044,8 +1044,8 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<Media> call, Throwable t) {
|
public void onFailure(Call<Media> call, Throwable t) {
|
||||||
Log.d(TAG, t.getMessage());
|
Log.d(TAG, "Upload request failed. " + t.getMessage());
|
||||||
onUploadFailure(item, false);
|
onUploadFailure(item, call.isCanceled());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1079,8 +1079,11 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
|
||||||
if (finishingUploadDialog != null) {
|
if (finishingUploadDialog != null) {
|
||||||
finishingUploadDialog.cancel();
|
finishingUploadDialog.cancel();
|
||||||
}
|
}
|
||||||
|
if (!isCanceled) {
|
||||||
|
// If it is canceled, it's already been removed, otherwise do it.
|
||||||
removeMediaFromQueue(item);
|
removeMediaFromQueue(item);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void cancelReadyingMedia(QueuedMedia item) {
|
private void cancelReadyingMedia(QueuedMedia item) {
|
||||||
if (item.readyStage == QueuedMedia.ReadyStage.UPLOADING) {
|
if (item.readyStage == QueuedMedia.ReadyStage.UPLOADING) {
|
||||||
|
|
Loading…
Reference in a new issue