Commit 0085f1a8 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

Downloads: correctly update UI when view appears

parent 5ef21851
......@@ -66,6 +66,7 @@
if (pasteURL && ![[pasteURL scheme] isEqualToString:@""] && ![[pasteURL absoluteString] isEqualToString:@""])
self.urlField.text = [pasteURL absoluteString];
}
[self _updateUI];
[super viewWillAppear:animated];
}
......@@ -109,6 +110,16 @@
}
}
- (void)_updateUI
{
if (_currentDownloadType != 0)
[self downloadStarted];
else
[self downloadEnded];
[self.downloadsTable reloadData];
}
#pragma mark - download management
- (void)_triggerNextDownload
{
......@@ -132,9 +143,8 @@
} else
APLog(@"Unknown download scheme '%@'", downloadScheme);
[self.activityIndicator startAnimating];
[_currentDownloads removeObjectAtIndex:0];
[self.downloadsTable reloadData];
[self _updateUI];
} else
_currentDownloadType = 0;
}
......@@ -176,6 +186,7 @@
self.currentDownloadLabel.hidden = YES;
self.progressView.hidden = YES;
self.cancelButton.hidden = YES;
_currentDownloadType = 0;
APLog(@"download ended");
[self _triggerNextDownload];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment