Fixes bug where "The upload failed." error message shows up when media upload is canceled intentionally.

main
Vavassor 8 years ago
parent c3b9002419
commit 9d98c7e63a
  1. 7
      app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java

@ -1044,8 +1044,8 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
@Override
public void onFailure(Call<Media> call, Throwable t) {
Log.d(TAG, t.getMessage());
onUploadFailure(item, false);
Log.d(TAG, "Upload request failed. " + t.getMessage());
onUploadFailure(item, call.isCanceled());
}
});
}
@ -1079,8 +1079,11 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
if (finishingUploadDialog != null) {
finishingUploadDialog.cancel();
}
if (!isCanceled) {
// If it is canceled, it's already been removed, otherwise do it.
removeMediaFromQueue(item);
}
}
private void cancelReadyingMedia(QueuedMedia item) {
if (item.readyStage == QueuedMedia.ReadyStage.UPLOADING) {

Loading…
Cancel
Save