mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Expand new or newly active accounts so that they don't look broken
This commit is contained in:
@@ -345,9 +345,21 @@ protocol SidebarDelegate: class {
|
||||
// MARK: - API
|
||||
|
||||
func rebuildTreeAndRestoreSelection() {
|
||||
|
||||
let savedAccounts = treeController.rootNode.childNodes.compactMap { $0.representedObject as? Account }
|
||||
|
||||
let savedSelection = selectedNodes
|
||||
rebuildTreeAndReloadDataIfNeeded()
|
||||
restoreSelection(to: savedSelection, sendNotificationIfChanged: true)
|
||||
|
||||
// Automatically expand any new or newly active accounts
|
||||
AccountManager.shared.activeAccounts.forEach { account in
|
||||
if !savedAccounts.contains(account) {
|
||||
let accountNode = treeController.nodeInTreeRepresentingObject(account)
|
||||
outlineView.expandItem(accountNode)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user