mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-01 04:31:00 +00:00
Fix the marker restore
This commit is contained in:
parent
df19135e19
commit
4338e0a355
1 changed files with 8 additions and 3 deletions
|
@ -11,7 +11,9 @@ import SwiftUI
|
||||||
var statusesState: StatusesState = .loading
|
var statusesState: StatusesState = .loading
|
||||||
var timeline: TimelineFilter = .home {
|
var timeline: TimelineFilter = .home {
|
||||||
willSet {
|
willSet {
|
||||||
if timeline == .home, newValue != .resume {
|
if timeline == .home,
|
||||||
|
newValue != .resume,
|
||||||
|
newValue != timeline {
|
||||||
saveMarker()
|
saveMarker()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,8 +178,11 @@ extension TimelineViewModel: StatusesFetcher {
|
||||||
func fetchStatuses(from: Marker.Content) async throws {
|
func fetchStatuses(from: Marker.Content) async throws {
|
||||||
guard let client else { return }
|
guard let client else { return }
|
||||||
statusesState = .loading
|
statusesState = .loading
|
||||||
var statuses: [Status] = try await statusFetcher.fetchFirstPage(client: client,
|
var statuses: [Status] = try await client.get(endpoint: timeline.endpoint(sinceId: nil,
|
||||||
timeline: timeline)
|
maxId: from.lastReadId,
|
||||||
|
minId: nil,
|
||||||
|
offset: 0,
|
||||||
|
limit: 40))
|
||||||
|
|
||||||
StatusDataControllerProvider.shared.updateDataControllers(for: statuses, client: client)
|
StatusDataControllerProvider.shared.updateDataControllers(for: statuses, client: client)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue