From 4c1061cfba9fc26f1a2cddc93ecb88198231a8f3 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 26 Jul 2020 16:00:00 -0500 Subject: [PATCH] Fix bug that caused currently selected item to not be found on next unread --- Multiplatform/Shared/Sidebar/SidebarExpandedContainers.swift | 4 ++++ Multiplatform/Shared/Sidebar/SidebarModel.swift | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Multiplatform/Shared/Sidebar/SidebarExpandedContainers.swift b/Multiplatform/Shared/Sidebar/SidebarExpandedContainers.swift index fcec7d03b..878be0408 100644 --- a/Multiplatform/Shared/Sidebar/SidebarExpandedContainers.swift +++ b/Multiplatform/Shared/Sidebar/SidebarExpandedContainers.swift @@ -26,6 +26,10 @@ struct SidebarExpandedContainers { } } + func contains(_ containerID: ContainerIdentifier) -> Bool { + return expandedTable.keys.contains(containerID) + } + subscript(_ containerID: ContainerIdentifier) -> Bool { get { if let result = expandedTable[containerID] { diff --git a/Multiplatform/Shared/Sidebar/SidebarModel.swift b/Multiplatform/Shared/Sidebar/SidebarModel.swift index 24d93c825..a4fabbad4 100644 --- a/Multiplatform/Shared/Sidebar/SidebarModel.swift +++ b/Multiplatform/Shared/Sidebar/SidebarModel.swift @@ -289,7 +289,6 @@ private extension SidebarModel { section.visit { sidebarItem in if !foundStartFeed && sidebarItem.feed?.feedID == startingAt.feedID { foundStartFeed = true - return false } if foundStartFeed && sidebarItem.unreadCount > 0 { nextSidebarItem = sidebarItem