Avoid cancellation issues in InlineLoadingView

This commit is contained in:
William Brawner 2022-05-17 19:56:43 -06:00
parent 04b0bfb4ec
commit c361728ae1

View file

@ -20,9 +20,6 @@ struct InlineLoadingView<Content, Data>: View where Content: View, Data: Equatab
switch self.data { switch self.data {
case .empty, .loading: case .empty, .loading:
ActivityIndicator(isAnimating: .constant(true), style: .large) ActivityIndicator(isAnimating: .constant(true), style: .large)
.task {
await action()
}
case .error(let error, _): case .error(let error, _):
Text(LocalizedStringKey(errorTextLocalizedStringKey)) Text(LocalizedStringKey(errorTextLocalizedStringKey))
Text(error.localizedDescription) Text(error.localizedDescription)