File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
SDWebImageSwiftUI/Classes Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -137,12 +137,12 @@ public struct WebImage : View {
137
137
/// Placeholder View Support
138
138
func setupPlaceholder( ) -> some View {
139
139
// Don't use `Group` because it will trigger `.onAppear` and `.onDisappear` when condition view removed, treat placeholder as an entire component
140
- if placeholder != nil {
140
+ if let placeholder = placeholder {
141
141
// If use `.delayPlaceholder`, the placeholder is applied after loading failed, hide during loading :)
142
142
if imageManager. options. contains ( . delayPlaceholder) && imageManager. isLoading {
143
143
return AnyView ( configure ( image: Image . empty) )
144
144
} else {
145
- return AnyView ( placeholder)
145
+ return placeholder
146
146
}
147
147
} else {
148
148
return AnyView ( configure ( image: Image . empty) )
You can’t perform that action at this time.
0 commit comments