Add rebuildTreeAndRestoreSelection method and use it where appropriate in SidebarViewController.
This commit is contained in:
parent
3a5741a5dd
commit
7ce4a21194
|
@ -83,13 +83,11 @@ import RSCore
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func containerChildrenDidChange(_ note: Notification) {
|
@objc func containerChildrenDidChange(_ note: Notification) {
|
||||||
|
rebuildTreeAndRestoreSelection()
|
||||||
rebuildTreeAndReloadDataIfNeeded()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func batchUpdateDidPerform(_ notification: Notification) {
|
@objc func batchUpdateDidPerform(_ notification: Notification) {
|
||||||
|
rebuildTreeAndRestoreSelection()
|
||||||
rebuildTreeAndReloadDataIfNeeded()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func userDidAddFeed(_ notification: Notification) {
|
@objc func userDidAddFeed(_ notification: Notification) {
|
||||||
|
@ -297,6 +295,13 @@ import RSCore
|
||||||
animatingChanges = false
|
animatingChanges = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - API
|
||||||
|
|
||||||
|
func rebuildTreeAndRestoreSelection() {
|
||||||
|
let savedSelection = selectedNodes
|
||||||
|
rebuildTreeAndReloadDataIfNeeded()
|
||||||
|
restoreSelection(to: savedSelection, sendNotificationIfChanged: true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - NSUserInterfaceValidations
|
// MARK: - NSUserInterfaceValidations
|
||||||
|
|
Loading…
Reference in New Issue