only show Progress Dialog if necessary when sending toot (#1470)

This commit is contained in:
Konrad Pozniak 2019-09-06 21:40:11 +02:00 committed by GitHub
parent 21fc3cba4f
commit 2a52305190
2 changed files with 8 additions and 0 deletions

View File

@ -1101,6 +1101,10 @@ public final class ComposeActivity
}
private void readyStatus(final Status.Visibility visibility, final boolean sensitive) {
if (waitForMediaLatch.isEmpty()) {
onReadySuccess(visibility, sensitive);
return;
}
finishingUploadDialog = ProgressDialog.show(
this, getString(R.string.dialog_title_finishing_media_upload),
getString(R.string.dialog_message_uploading_media), true, true);

View File

@ -44,4 +44,8 @@ public class CountUpDownLatch {
wait();
}
}
public synchronized boolean isEmpty() {
return count == 0;
}
}