Browse Source

Remove the unnecessary dispatch when set image

onevcat 5 năm trước cách đây
mục cha
commit
5c86cb6606
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      Sources/SwiftUI/KFImage.swift

+ 3 - 5
Sources/SwiftUI/KFImage.swift

@@ -173,11 +173,9 @@ struct KFImageRenderer: View {
                         self.loadingResult = result
                         switch result {
                         case .success(let value):
-                            CallbackQueue.mainAsync.execute {
-                                let animation = fadeTransitionDuration(cacheType: value.cacheType)
-                                    .map { duration in Animation.linear(duration: duration) }
-                                withAnimation(animation) { isLoaded = true }
-                            }
+                            let animation = fadeTransitionDuration(cacheType: value.cacheType)
+                                .map { duration in Animation.linear(duration: duration) }
+                            withAnimation(animation) { isLoaded = true }
                         case .failure(_):
                             break
                         }