SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.14k stars 219 forks source link

AnimatedImage gets stuck on failure #204

Open Enricoza opened 2 years ago

Enricoza commented 2 years ago

Just by adding an AnimatedImage with a failing url causes the AnimatedImage to fall in an endless loop where it tries to load itself and just fails to do so each time, getting updateUIView triggered every time it fails.

The effect is even worse if the url is invalid as it gets stuck on the main thread.

Just a simple empty project with this ContentView is enough to display the problem.

struct ContentView: View {
    var body: some View {
        AnimatedImage(url: URL(string: "something"))
            .onFailure(perform: { err in
                print("Error", err)
            })
    }
}