mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-06-06 05:48:50 +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
|
index > 0
|
||||||
{
|
{
|
||||||
// Restore cache and scroll to latest seen status.
|
// 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
|
scrollToIndexAnimated = false
|
||||||
scrollToIndex = index + 1
|
scrollToIndex = index + 1
|
||||||
} else {
|
} else {
|
||||||
// Restore cache and scroll to top.
|
// Restore cache and scroll to top.
|
||||||
withAnimation {
|
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.
|
// And then we fetch statuses again toget newest statuses from there.
|
||||||
|
@ -308,7 +308,7 @@ extension TimelineViewModel: StatusesFetcher {
|
||||||
|
|
||||||
statuses.append(contentsOf: newStatuses)
|
statuses.append(contentsOf: newStatuses)
|
||||||
|
|
||||||
statusesState = .display(statuses: statuses, nextPageState: .hasNextPage)
|
statusesState = .display(statuses: statuses, nextPageState: newStatuses.count < 20 ? .none : .hasNextPage)
|
||||||
} catch {
|
} catch {
|
||||||
statusesState = .error(error: error)
|
statusesState = .error(error: error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue