diff --git a/Packages/Components/Sources/CachedAsyncImage.swift b/Packages/Components/Sources/CachedAsyncImage.swift index 4ba71d77..02a46ed8 100644 --- a/Packages/Components/Sources/CachedAsyncImage.swift +++ b/Packages/Components/Sources/CachedAsyncImage.swift @@ -79,7 +79,7 @@ public struct CachedAsyncImage: View where Content: View { public var body: some View { content(phase) - .task(id: urlRequest, load) + .task(id: urlRequest) { await load() } } /// Loads and displays an image from the specified URL. @@ -311,8 +311,7 @@ public struct CachedAsyncImage: View where Content: View { self._phase = State(wrappedValue: .failure(error)) } } - - @Sendable + private func load() async { do { if let urlRequest = urlRequest {