mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-16 04:06:36 +00:00
Rename timeline related files
This commit is contained in:
parent
acccdb8041
commit
7add850fe6
4 changed files with 7 additions and 7 deletions
|
@ -4,7 +4,7 @@ import Observation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
@Observable final class TimelinePrefetcher: NSObject, UICollectionViewDataSourcePrefetching {
|
@Observable final class TimelineMediaPrefetcher: NSObject, UICollectionViewDataSourcePrefetching {
|
||||||
private let prefetcher = ImagePrefetcher()
|
private let prefetcher = ImagePrefetcher()
|
||||||
|
|
||||||
weak var viewModel: TimelineViewModel?
|
weak var viewModel: TimelineViewModel?
|
|
@ -6,7 +6,7 @@ import SwiftUI
|
||||||
import DesignSystem
|
import DesignSystem
|
||||||
|
|
||||||
@MainActor
|
@MainActor
|
||||||
@Observable class PendingStatusesObserver {
|
@Observable class TimelineUnreadStatusesObserver {
|
||||||
var pendingStatusesCount: Int = 0
|
var pendingStatusesCount: Int = 0
|
||||||
|
|
||||||
var disableUpdate: Bool = false
|
var disableUpdate: Bool = false
|
||||||
|
@ -30,8 +30,8 @@ import DesignSystem
|
||||||
init() {}
|
init() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PendingStatusesObserverView: View {
|
struct TimelineUnreadStatusesView: View {
|
||||||
@State var observer: PendingStatusesObserver
|
@State var observer: TimelineUnreadStatusesObserver
|
||||||
@Environment(UserPreferences.self) private var preferences
|
@Environment(UserPreferences.self) private var preferences
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
|
|
|
@ -19,7 +19,7 @@ public struct TimelineView: View {
|
||||||
@Environment(RouterPath.self) private var routerPath
|
@Environment(RouterPath.self) private var routerPath
|
||||||
|
|
||||||
@State private var viewModel = TimelineViewModel()
|
@State private var viewModel = TimelineViewModel()
|
||||||
@State private var prefetcher = TimelinePrefetcher()
|
@State private var prefetcher = TimelineMediaPrefetcher()
|
||||||
|
|
||||||
@State private var wasBackgrounded: Bool = false
|
@State private var wasBackgrounded: Bool = false
|
||||||
@State private var collectionView: UICollectionView?
|
@State private var collectionView: UICollectionView?
|
||||||
|
@ -77,7 +77,7 @@ public struct TimelineView: View {
|
||||||
collectionView.prefetchDataSource = prefetcher
|
collectionView.prefetchDataSource = prefetcher
|
||||||
}
|
}
|
||||||
if viewModel.timeline.supportNewestPagination {
|
if viewModel.timeline.supportNewestPagination {
|
||||||
PendingStatusesObserverView(observer: viewModel.pendingStatusesObserver)
|
TimelineUnreadStatusesView(observer: viewModel.pendingStatusesObserver)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.safeAreaInset(edge: .top) {
|
.safeAreaInset(edge: .top) {
|
||||||
|
|
|
@ -74,7 +74,7 @@ import SwiftUI
|
||||||
}
|
}
|
||||||
|
|
||||||
var isTimelineVisible: Bool = false
|
var isTimelineVisible: Bool = false
|
||||||
let pendingStatusesObserver: PendingStatusesObserver = .init()
|
let pendingStatusesObserver: TimelineUnreadStatusesObserver = .init()
|
||||||
var scrollToIndexAnimated: Bool = false
|
var scrollToIndexAnimated: Bool = false
|
||||||
var marker: Marker.Content?
|
var marker: Marker.Content?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue