Skip to content

Commit e7c6931

Browse files
committed
Naming it as isSuccess to match what it check
1 parent 57ed6ef commit e7c6931

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

SDWebImageSwiftUI/Classes/ImageManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ImageManager : ObservableObject {
1616

1717
var manager = SDWebImageManager.shared
1818
weak var currentOperation: SDWebImageOperation? = nil
19-
var isFinished: Bool = false // true means request end, load() do nothing
19+
var isSuccess: Bool = false // true means request for this URL is ended forever, load() do nothing
2020
var isIncremental: Bool = false // true means during incremental loading
2121

2222
var url: URL?
@@ -70,7 +70,7 @@ class ImageManager : ObservableObject {
7070
self.isLoading = false
7171
self.progress = 1
7272
if let image = image {
73-
self.isFinished = true
73+
self.isSuccess = true
7474
self.successBlock?(image, cacheType)
7575
} else {
7676
self.failureBlock?(error ?? NSError())

SDWebImageSwiftUI/Classes/WebImage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ public struct WebImage : View {
5555
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
5656
.onAppear {
5757
guard self.retryOnAppear else { return }
58-
if !self.imageManager.isFinished {
58+
if !self.imageManager.isSuccess {
5959
self.imageManager.load()
6060
}
6161
}
6262
.onDisappear {
6363
guard self.cancelOnDisappear else { return }
6464
// When using prorgessive loading, the previous partial image will cause onDisappear. Filter this case
65-
if !self.imageManager.isFinished && !self.imageManager.isIncremental {
65+
if !self.imageManager.isSuccess && !self.imageManager.isIncremental {
6666
self.imageManager.cancel()
6767
}
6868
}

0 commit comments

Comments
 (0)