* Cancel media uploads on remove the draft message * Fix formatting
This commit is contained in:
parent
84f561af17
commit
bc3ea2357b
|
@ -1539,13 +1539,21 @@ public final class ComposeActivity
|
|||
new AlertDialog.Builder(this)
|
||||
.setMessage(R.string.compose_save_draft)
|
||||
.setPositiveButton(R.string.action_save, (d, w) -> saveDraftAndFinish())
|
||||
.setNegativeButton(R.string.action_delete, (d, w) -> finishWithoutSlideOutAnimation())
|
||||
.setNegativeButton(R.string.action_delete, (d, w) -> deleteDraftAndFinish())
|
||||
.show();
|
||||
} else {
|
||||
finishWithoutSlideOutAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteDraftAndFinish() {
|
||||
for (QueuedMedia media : mediaQueued) {
|
||||
if (media.uploadRequest != null)
|
||||
media.uploadRequest.cancel();
|
||||
}
|
||||
finishWithoutSlideOutAnimation();
|
||||
}
|
||||
|
||||
private void saveDraftAndFinish() {
|
||||
ArrayList<String> mediaUris = new ArrayList<>();
|
||||
ArrayList<String> mediaDescriptions = new ArrayList<>();
|
||||
|
|
Loading…
Reference in New Issue