mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-16 04:06:36 +00:00
Proper fix for looping timeline
This commit is contained in:
parent
1e7c25993a
commit
47436daaf2
3 changed files with 13 additions and 14 deletions
|
@ -48,7 +48,6 @@ public struct StatusesListView<Fetcher>: View where Fetcher: StatusesFetcher {
|
||||||
|
|
||||||
case let .display(statuses, nextPageState):
|
case let .display(statuses, nextPageState):
|
||||||
ForEach(statuses, id: \.viewId) { status in
|
ForEach(statuses, id: \.viewId) { status in
|
||||||
if !status.isHidden {
|
|
||||||
StatusRowView(viewModel: StatusRowViewModel(status: status,
|
StatusRowView(viewModel: StatusRowViewModel(status: status,
|
||||||
client: client,
|
client: client,
|
||||||
routerPath: routerPath,
|
routerPath: routerPath,
|
||||||
|
@ -61,7 +60,6 @@ public struct StatusesListView<Fetcher>: View where Fetcher: StatusesFetcher {
|
||||||
fetcher.statusDidDisappear(status: status)
|
fetcher.statusDidDisappear(status: status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
switch nextPageState {
|
switch nextPageState {
|
||||||
case .hasNextPage:
|
case .hasNextPage:
|
||||||
loadingRow
|
loadingRow
|
||||||
|
|
|
@ -269,6 +269,7 @@ extension TimelineViewModel: StatusesFetcher {
|
||||||
StatusDataControllerProvider.shared.updateDataControllers(for: statuses, client: client)
|
StatusDataControllerProvider.shared.updateDataControllers(for: statuses, client: client)
|
||||||
|
|
||||||
await datasource.set(statuses)
|
await datasource.set(statuses)
|
||||||
|
statuses = await datasource.get()
|
||||||
await cacheHome()
|
await cacheHome()
|
||||||
|
|
||||||
withAnimation {
|
withAnimation {
|
||||||
|
|
|
@ -9,7 +9,7 @@ actor TimelineDatasource {
|
||||||
}
|
}
|
||||||
|
|
||||||
func get() -> [Status] {
|
func get() -> [Status] {
|
||||||
statuses
|
statuses.filter{ !$0.isHidden }
|
||||||
}
|
}
|
||||||
|
|
||||||
func count() -> Int {
|
func count() -> Int {
|
||||||
|
|
Loading…
Reference in a new issue