Deselect articles when switching selected feeds
This commit is contained in:
parent
0425bb8ae3
commit
2b0f6f4e77
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user