Revert the wrong changes to fix the unit test
This commit is contained in:
parent
3340ea4ed4
commit
c8320d4e20
|
@ -17,6 +17,7 @@ class UserSettings: ObservableObject {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !os(watchOS)
|
||||
struct ContentView4: View {
|
||||
var url = URL(string: "https://github.com/SDWebImage/SDWebImageSwiftUI/assets/97430818/72d27f90-e9d8-48d7-b144-82ada828a027")!
|
||||
var body: some View {
|
||||
|
@ -27,6 +28,7 @@ struct ContentView4: View {
|
|||
.clipShape(RoundedRectangle(cornerRadius: 50, style: .continuous))
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Test Switching nil url
|
||||
struct ContentView3: View {
|
||||
|
|
|
@ -309,8 +309,6 @@ public struct AnimatedImage : PlatformViewRepresentable {
|
|||
#endif
|
||||
context.coordinator.imageLoading.imageName = name
|
||||
view.wrapped.image = image
|
||||
// Finished loading, sync
|
||||
finishUpdateView(view, context: context, image: image)
|
||||
}
|
||||
|
||||
private func updateViewForData(_ data: Data?, view: AnimatedImageViewWrapper, context: Context) {
|
||||
|
@ -324,8 +322,6 @@ public struct AnimatedImage : PlatformViewRepresentable {
|
|||
}
|
||||
context.coordinator.imageLoading.imageData = data
|
||||
view.wrapped.image = image
|
||||
// Finished loading, sync
|
||||
finishUpdateView(view, context: context, image: image)
|
||||
}
|
||||
|
||||
private func updateViewForURL(_ url: URL?, view: AnimatedImageViewWrapper, context: Context) {
|
||||
|
@ -350,8 +346,6 @@ public struct AnimatedImage : PlatformViewRepresentable {
|
|||
setupIndicator(view, context: context)
|
||||
loadImage(view, context: context)
|
||||
}
|
||||
// Finished loading, sync
|
||||
finishUpdateView(view, context: context, image: view.wrapped.image)
|
||||
}
|
||||
|
||||
func updateView(_ view: AnimatedImageViewWrapper, context: Context) {
|
||||
|
@ -369,6 +363,9 @@ public struct AnimatedImage : PlatformViewRepresentable {
|
|||
break // impossible
|
||||
}
|
||||
|
||||
// Finished loading, sync
|
||||
finishUpdateView(view, context: context, image: view.wrapped.image)
|
||||
|
||||
if let viewUpdateBlock = imageHandler.viewUpdateBlock {
|
||||
viewUpdateBlock(view.wrapped, context)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue