Don't delay hiding the progress bar unless we are animating it.

This commit is contained in:
Maurice Parker 2020-10-25 12:46:25 -05:00
parent b0fc1eccca
commit 807b2d3109
1 changed files with 11 additions and 2 deletions

View File

@ -67,9 +67,10 @@ private extension RefreshProgressView {
if isInViewHierarchy { if isInViewHierarchy {
progressView.setProgress(1, animated: animated) progressView.setProgress(1, animated: animated)
} }
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
func completeLabel() {
// Check that there are no pending downloads. // Check that there are no pending downloads.
if (AccountManager.shared.combinedRefreshProgress.isComplete) { if AccountManager.shared.combinedRefreshProgress.isComplete {
self.updateRefreshLabel() self.updateRefreshLabel()
self.label.isHidden = false self.label.isHidden = false
self.progressView.isHidden = true self.progressView.isHidden = true
@ -78,6 +79,14 @@ private extension RefreshProgressView {
} }
} }
} }
if animated {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
completeLabel()
}
} else {
completeLabel()
}
} else { } else {
label.isHidden = true label.isHidden = true
progressView.isHidden = false progressView.isHidden = false