Implement Refresh to Clear Articles option. Issue #1601

This commit is contained in:
Maurice Parker
2020-01-10 18:14:21 -07:00
parent 566aae9498
commit e93b916c50
5 changed files with 85 additions and 18 deletions

View File

@@ -139,10 +139,15 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
@objc func refreshAccounts(_ sender: Any) {
refreshControl?.endRefreshing()
// This is a hack to make sure that an error dialog doesn't interfere with dismissing the refreshControl.
// If the error dialog appears too closely to the call to endRefreshing, then the refreshControl never disappears.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
AccountManager.shared.refreshAll(errorHandler: ErrorHandler.present(self))
AccountManager.shared.refreshAll(errorHandler: ErrorHandler.present(self)) {
if AppDefaults.refreshClearsReadArticles {
self.coordinator.refreshTimeline(resetScroll: false)
}
}
}
}