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 344863b5d4
commit d83e7c4c70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}
}