mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-11 08:35:26 +00:00
Fix next page state
This commit is contained in:
parent
65ed2d871c
commit
e96c1c5da7
1 changed files with 3 additions and 3 deletions
|
@ -174,13 +174,13 @@ extension TimelineViewModel: StatusesFetcher {
|
|||
index > 0
|
||||
{
|
||||
// Restore cache and scroll to latest seen status.
|
||||
statusesState = .display(statuses: statuses, nextPageState: statuses.count < 20 ? .none : .hasNextPage)
|
||||
statusesState = .display(statuses: statuses, nextPageState: .hasNextPage)
|
||||
scrollToIndexAnimated = false
|
||||
scrollToIndex = index + 1
|
||||
} else {
|
||||
// Restore cache and scroll to top.
|
||||
withAnimation {
|
||||
statusesState = .display(statuses: statuses, nextPageState: statuses.count < 20 ? .none : .hasNextPage)
|
||||
statusesState = .display(statuses: statuses, nextPageState: .hasNextPage)
|
||||
}
|
||||
}
|
||||
// And then we fetch statuses again toget newest statuses from there.
|
||||
|
@ -308,7 +308,7 @@ extension TimelineViewModel: StatusesFetcher {
|
|||
|
||||
statuses.append(contentsOf: newStatuses)
|
||||
|
||||
statusesState = .display(statuses: statuses, nextPageState: .hasNextPage)
|
||||
statusesState = .display(statuses: statuses, nextPageState: newStatuses.count < 20 ? .none : .hasNextPage)
|
||||
} catch {
|
||||
statusesState = .error(error: error)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue