From 7d68e3322ce65392e90411154a3f705a381e2245 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 18 Dec 2017 12:43:18 -0800 Subject: [PATCH] =?UTF-8?q?Reuse=20account=20nodes,=20which=20should=20fix?= =?UTF-8?q?=20at=20least=20one=20cause=20of=20the=20bug=20where=20sometime?= =?UTF-8?q?s=20the=20On=20My=20Mac=20group=20item=20collapses=20when=20it?= =?UTF-8?q?=20shouldn=E2=80=99t.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainWindow/Sidebar/SidebarTreeControllerDelegate.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Evergreen/MainWindow/Sidebar/SidebarTreeControllerDelegate.swift b/Evergreen/MainWindow/Sidebar/SidebarTreeControllerDelegate.swift index af22e3d24..7ed314adf 100644 --- a/Evergreen/MainWindow/Sidebar/SidebarTreeControllerDelegate.swift +++ b/Evergreen/MainWindow/Sidebar/SidebarTreeControllerDelegate.swift @@ -107,7 +107,12 @@ private extension SidebarTreeControllerDelegate { func sortedAccountNodes(_ parent: Node) -> [Node] { - let nodes = AccountManager.shared.accounts.map { createNode(account: $0, parent: parent) } + let nodes = AccountManager.shared.accounts.map { (account) -> Node in + let accountNode = parent.existingOrNewChildNode(with: account) + accountNode.canHaveChildNodes = true + accountNode.isGroupItem = true + return accountNode + } return nodes.sortedAlphabetically() }