mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-03 12:27:32 +01:00
Prevent refresh errors from keeping the refreshControl visible when error dialogs are displayed.
This commit is contained in:
parent
8a5730267b
commit
b25e789aef
@ -596,10 +596,14 @@ extension MasterFeedViewController: MasterFeedTableViewCellDelegate {
|
||||
private extension MasterFeedViewController {
|
||||
|
||||
@objc private func refreshAccounts(_ sender: Any) {
|
||||
AccountManager.shared.refreshAll(errorHandler: ErrorHandler.present(self))
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func updateUI() {
|
||||
markAllAsReadButton.isEnabled = coordinator.isAnyUnreadAvailable
|
||||
addNewItemButton.isEnabled = !AccountManager.shared.activeAccounts.isEmpty
|
||||
|
@ -339,8 +339,12 @@ class MasterTimelineViewController: ProgressTableViewController, UndoableCommand
|
||||
private extension MasterTimelineViewController {
|
||||
|
||||
@objc private func refreshAccounts(_ sender: Any) {
|
||||
AccountManager.shared.refreshAll(errorHandler: ErrorHandler.present(self))
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
func resetUI() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user