Use BatchUpdate.shared.
This commit is contained in:
parent
c258a9da5c
commit
0f19fda54d
|
@ -16,7 +16,6 @@ import Account
|
|||
|
||||
let appName = "Evergreen"
|
||||
var currentTheme: VSTheme!
|
||||
let batchUpdate = BatchUpdate()
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
|
||||
|
|
|
@ -17,6 +17,8 @@ public extension Notification.Name {
|
|||
|
||||
final class BatchUpdate {
|
||||
|
||||
static let shared = BatchUpdate()
|
||||
|
||||
private var count = 0
|
||||
|
||||
var isPerforming: Bool {
|
||||
|
|
|
@ -73,7 +73,7 @@ import Account
|
|||
outlineView.removeItems(at: selectedRows, inParent: nil, withAnimation: [.slideDown])
|
||||
outlineView.endUpdates()
|
||||
|
||||
batchUpdate.perform {
|
||||
BatchUpdate.shared.perform {
|
||||
deleteItemsForNodes(nodesToDelete)
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ private extension SidebarViewController {
|
|||
|
||||
func rebuildTreeAndReloadDataIfNeeded() {
|
||||
|
||||
if !batchUpdate.isPerforming {
|
||||
if !BatchUpdate.shared.isPerforming {
|
||||
treeController.rebuild()
|
||||
outlineView.reloadData()
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ struct FeedsImporter {
|
|||
|
||||
let feedsToImport = feeds(with: feedDictionaries, accountID: account.accountID)
|
||||
|
||||
batchUpdate.perform {
|
||||
BatchUpdate.shared.perform {
|
||||
for feed in feedsToImport {
|
||||
if !account.hasFeed(with: feed.feedID) {
|
||||
let _ = account.addFeed(feed, to: nil)
|
||||
|
|
|
@ -38,7 +38,7 @@ struct OPMLImporter {
|
|||
}
|
||||
|
||||
if let opmlDocument = opmlDocument {
|
||||
batchUpdate.perform {
|
||||
BatchUpdate.shared.perform {
|
||||
account.importOPML(opmlDocument)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue