Correct usage of BatchUpdate so that UI remains responsive after error messages Issue #752

This commit is contained in:
Maurice Parker 2019-06-13 14:50:41 -05:00
parent 871dbbb752
commit 6527ac852c
1 changed files with 4 additions and 1 deletions

View File

@ -327,9 +327,10 @@ private extension SidebarOutlineDataSource {
BatchUpdate.shared.start() BatchUpdate.shared.start()
source.account?.moveFeed(feed, from: source, to: destination) { result in source.account?.moveFeed(feed, from: source, to: destination) { result in
BatchUpdate.shared.end()
switch result { switch result {
case .success: case .success:
BatchUpdate.shared.end() break
case .failure(let error): case .failure(let error):
NSApplication.shared.presentError(error) NSApplication.shared.presentError(error)
} }
@ -389,6 +390,7 @@ private extension SidebarOutlineDataSource {
} }
} }
case .failure(let error): case .failure(let error):
BatchUpdate.shared.end()
NSApplication.shared.presentError(error) NSApplication.shared.presentError(error)
} }
} }
@ -409,6 +411,7 @@ private extension SidebarOutlineDataSource {
} }
} }
case .failure(let error): case .failure(let error):
BatchUpdate.shared.end()
NSApplication.shared.presentError(error) NSApplication.shared.presentError(error)
} }
} }