mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-17 04:36:39 +00:00
Status detail: Don't cancel the task
This commit is contained in:
parent
f235ebb720
commit
aee6459bcf
1 changed files with 11 additions and 9 deletions
|
@ -81,19 +81,21 @@ public struct StatusDetailView: View {
|
||||||
proxy.scrollTo(newValue, anchor: .top)
|
proxy.scrollTo(newValue, anchor: .top)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.task {
|
.onAppear {
|
||||||
guard !isLoaded else { return }
|
guard !isLoaded else { return }
|
||||||
viewModel.client = client
|
viewModel.client = client
|
||||||
viewModel.routerPath = routerPath
|
viewModel.routerPath = routerPath
|
||||||
let result = await viewModel.fetch()
|
Task {
|
||||||
isLoaded = true
|
let result = await viewModel.fetch()
|
||||||
|
isLoaded = true
|
||||||
|
|
||||||
if !result {
|
if !result {
|
||||||
if let url = viewModel.remoteStatusURL {
|
if let url = viewModel.remoteStatusURL {
|
||||||
await UIApplication.shared.open(url)
|
await UIApplication.shared.open(url)
|
||||||
}
|
}
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
_ = routerPath.path.popLast()
|
_ = routerPath.path.popLast()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue