Rename timeline related files
This commit is contained in:
parent
acccdb8041
commit
7add850fe6
|
@ -4,7 +4,7 @@ import Observation
|
|||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
@Observable final class TimelinePrefetcher: NSObject, UICollectionViewDataSourcePrefetching {
|
||||
@Observable final class TimelineMediaPrefetcher: NSObject, UICollectionViewDataSourcePrefetching {
|
||||
private let prefetcher = ImagePrefetcher()
|
||||
|
||||
weak var viewModel: TimelineViewModel?
|
|
@ -6,7 +6,7 @@ import SwiftUI
|
|||
import DesignSystem
|
||||
|
||||
@MainActor
|
||||
@Observable class PendingStatusesObserver {
|
||||
@Observable class TimelineUnreadStatusesObserver {
|
||||
var pendingStatusesCount: Int = 0
|
||||
|
||||
var disableUpdate: Bool = false
|
||||
|
@ -30,8 +30,8 @@ import DesignSystem
|
|||
init() {}
|
||||
}
|
||||
|
||||
struct PendingStatusesObserverView: View {
|
||||
@State var observer: PendingStatusesObserver
|
||||
struct TimelineUnreadStatusesView: View {
|
||||
@State var observer: TimelineUnreadStatusesObserver
|
||||
@Environment(UserPreferences.self) private var preferences
|
||||
@Environment(Theme.self) private var theme
|
||||
|
|
@ -19,7 +19,7 @@ public struct TimelineView: View {
|
|||
@Environment(RouterPath.self) private var routerPath
|
||||
|
||||
@State private var viewModel = TimelineViewModel()
|
||||
@State private var prefetcher = TimelinePrefetcher()
|
||||
@State private var prefetcher = TimelineMediaPrefetcher()
|
||||
|
||||
@State private var wasBackgrounded: Bool = false
|
||||
@State private var collectionView: UICollectionView?
|
||||
|
@ -77,7 +77,7 @@ public struct TimelineView: View {
|
|||
collectionView.prefetchDataSource = prefetcher
|
||||
}
|
||||
if viewModel.timeline.supportNewestPagination {
|
||||
PendingStatusesObserverView(observer: viewModel.pendingStatusesObserver)
|
||||
TimelineUnreadStatusesView(observer: viewModel.pendingStatusesObserver)
|
||||
}
|
||||
}
|
||||
.safeAreaInset(edge: .top) {
|
||||
|
|
|
@ -74,7 +74,7 @@ import SwiftUI
|
|||
}
|
||||
|
||||
var isTimelineVisible: Bool = false
|
||||
let pendingStatusesObserver: PendingStatusesObserver = .init()
|
||||
let pendingStatusesObserver: TimelineUnreadStatusesObserver = .init()
|
||||
var scrollToIndexAnimated: Bool = false
|
||||
var marker: Marker.Content?
|
||||
|
||||
|
|
Loading…
Reference in New Issue