Skip to content

Commit 1acafa9

Browse files
committed
Fix Indicator logic, no longer populate when is not loading (such as error)
1 parent 417f0fd commit 1acafa9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

SDWebImageSwiftUI/Classes/ImageManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class ImageManager : ObservableObject {
3434
if currentOperation != nil {
3535
return
3636
}
37+
self.image = nil
3738
self.isLoading = true
3839
currentOperation = manager.loadImage(with: url, options: options, context: context, progress: { [weak self] (receivedSize, expectedSize, _) in
3940
guard let self = self else {

SDWebImageSwiftUI/Classes/Indicator/Indicator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct IndicatorViewModifier<T> : ViewModifier where T : View {
3232
let indicatorView: T
3333

3434
func body(content: Content) -> some View {
35-
if (imageManager.image != nil) && !imageManager.isLoading {
35+
if !imageManager.isLoading {
3636
// Disable Indiactor
3737
return AnyView(content)
3838
} else {

0 commit comments

Comments
 (0)