Status detail: Don't cancel the task

This commit is contained in:
Thomas Ricouard 2024-01-01 21:29:28 +01:00
parent f235ebb720
commit aee6459bcf

View file

@ -81,10 +81,11 @@ public struct StatusDetailView: View {
proxy.scrollTo(newValue, anchor: .top)
}
}
.task {
.onAppear {
guard !isLoaded else { return }
viewModel.client = client
viewModel.routerPath = routerPath
Task {
let result = await viewModel.fetch()
isLoaded = true
@ -98,6 +99,7 @@ public struct StatusDetailView: View {
}
}
}
}
.refreshable {
Task {
await viewModel.fetch()