mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-02 10:22:35 +00:00
Defer rebuilding backing stores when a BatchUpdate is in progress. Fix #4949.
This commit is contained in:
1 parent
3941778121
commit
4a0a263f5d
1 file changed
+11
-3
@@ -461,7 +461,7 @@ struct FeedNode: Hashable, Sendable {
|
||||
guard AccountManager.shared.areUnreadCountsInitialized else {
|
||||
return
|
||||
}
|
||||
|
||||
Self.logger.debug("SceneCoordinator: unreadCountDidChange \(note.object.debugDescription)")
|
||||
queueRebuildBackingStores()
|
||||
}
|
||||
|
||||
@@ -1609,11 +1609,19 @@ private extension SceneCoordinator {
|
||||
static var rebuildCount = 0
|
||||
|
||||
func rebuildBackingStores(initialLoad: Bool = false, updateExpandedNodes: (() -> Void)? = nil, completion: (() -> Void)? = nil) {
|
||||
#if DEBUG
|
||||
Self.logger.debug("SceneCoordinator: rebuildBackingStores: # \(Self.rebuildCount) initialLoad \(initialLoad ? "true" : "false")")
|
||||
Self.rebuildCount += 1
|
||||
#endif
|
||||
|
||||
if isRebuildingBackingStores {
|
||||
Self.logger.debug("SceneCoordinator: rebuildBackingStores — skipping because isRebuildingBackingStores")
|
||||
if isRebuildingBackingStores || BatchUpdate.shared.isPerforming {
|
||||
#if DEBUG
|
||||
if isRebuildingBackingStores {
|
||||
Self.logger.debug("SceneCoordinator: rebuildBackingStores — skipping because isRebuildingBackingStores")
|
||||
} else {
|
||||
Self.logger.debug("SceneCoordinator: rebuildBackingStores — skipping because BatchUpdate.shared.isPerforming")
|
||||
}
|
||||
#endif
|
||||
queueRebuildBackingStores()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user