Skip to content

Commit 8d3a15d

Browse files
author
Simon Bachmann
authored
Merge pull request #23 from kamaal111/fix/crash-in-animation-on-background
Fix crash when app goes to background before animation is complete
2 parents 860ef2c + 4458eb4 commit 8d3a15d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Sources/ConfettiSwiftUI.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public struct ConfettiCannon: View {
130130
for i in 0...confettiConfig.repetitions{
131131
DispatchQueue.main.asyncAfter(deadline: .now() + confettiConfig.repetitionInterval * Double(i)) {
132132
animate.append(false)
133-
if(value < animate.count){
133+
if(value > 0 && value < animate.count){
134134
animate[value-1].toggle()
135135
}
136136
}

0 commit comments

Comments
 (0)