Reset pending statuses when reaching top

This commit is contained in:
Thomas Ricouard 2023-02-02 17:47:35 +01:00
parent bb6910cd83
commit e278eae144
1 changed files with 7 additions and 2 deletions

View File

@ -17,7 +17,13 @@ class TimelineViewModel: ObservableObject {
// Internal source of truth for a timeline.
private var statuses: [Status] = []
private var visibileStatusesIds = Set<String>()
var scrollToTopVisible: Bool = false
var scrollToTopVisible: Bool = false {
didSet {
if scrollToTopVisible {
pendingStatusesObserver.pendingStatuses = []
}
}
}
private var canStreamEvents: Bool = true
@ -52,7 +58,6 @@ class TimelineViewModel: ObservableObject {
}
@Published var tag: Tag?
@Published var pendingStatusesCount: Int = 0
var pendingStatusesEnabled: Bool {
timeline == .home