simibac / ConfettiSwiftUI

SwiftUI Package for Configurable Confetti Animation 🎉
MIT License
1.71k stars 117 forks source link

Crash when app goes to background before animation is complete #22

Closed twestley closed 2 years ago

twestley commented 2 years ago

Expected Behaviour

Animation stops when app goes to background or completes successfully while in background

Actual Behaviour

"Fatal error: Index out of range," on line 134, "animate[value-1].toggle()" value in this statement is 0 leading to "index out of range"

Steps to Reproduce the Issue

Screen Shot 2022-04-22 at 12 52 44 PM

simibac commented 2 years ago

Thanks for the PR. Should be fixed now in the latest release.