Deselect articles when switching selected feeds

This commit is contained in:
Maurice Parker 2020-07-16 12:27:40 -05:00
parent 0425bb8ae3
commit 2b0f6f4e77
2 changed files with 4 additions and 4 deletions

View File

@ -303,6 +303,9 @@ private extension TimelineModel {
func replaceArticles(with unsortedArticles: Set<Article>) { func replaceArticles(with unsortedArticles: Set<Article>) {
articles = Array(unsortedArticles).sortedByDate(sortDirection ? .orderedDescending : .orderedAscending, groupByFeed: groupByFeed) articles = Array(unsortedArticles).sortedByDate(sortDirection ? .orderedDescending : .orderedAscending, groupByFeed: groupByFeed)
rebuildTimelineItems() rebuildTimelineItems()
selectedArticleIDs = Set<String>()
selectedArticleID = nil
// TODO: Update unread counts and other item done in didSet on AppKit // TODO: Update unread counts and other item done in didSet on AppKit
} }

View File

@ -11,7 +11,7 @@ import SwiftUI
struct TimelineView: View { struct TimelineView: View {
@EnvironmentObject private var timelineModel: TimelineModel @EnvironmentObject private var timelineModel: TimelineModel
@State var navigate = false @State var navigate = true
@ViewBuilder var body: some View { @ViewBuilder var body: some View {
#if os(macOS) #if os(macOS)
@ -43,9 +43,6 @@ struct TimelineView: View {
TimelineItemView(timelineItem: timelineItem) TimelineItemView(timelineItem: timelineItem)
} }
} }
.onChange(of: timelineModel.selectedArticleIDs) { ids in
navigate = !ids.isEmpty
}
} }
.navigationTitle(Text(verbatim: timelineModel.nameForDisplay)) .navigationTitle(Text(verbatim: timelineModel.nameForDisplay))
#else #else