Skip to content

Commit 4544888

Browse files
committed
Fixed issue with initial image loading
1 parent 15f1800 commit 4544888

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

MacImageManager/MacImageManager/Views/PaneGifViewer.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,13 @@ struct PaneGifViewer: View {
103103
.background(Color(NSColor.controlBackgroundColor))
104104
}
105105
}
106-
.onAppear {
106+
.task(id: gifUrl) {
107+
loadGif(from: gifUrl)
107108
startAnimation()
108109
}
109110
.onDisappear {
110111
stopAnimation()
111112
}
112-
.onChange(of: gifUrl) { oldValue, newValue in
113-
loadGif(from: newValue)
114-
}
115113
.onChange(of: animationSpeed) { oldValue, newValue in
116114
if isPlaying {
117115
restartAnimation()

0 commit comments

Comments
 (0)