Add checks for container presence in animation functions to prevent errors when elements are removed from the DOM [skip ci]
This commit is contained in:
@@ -162,6 +162,7 @@ function startFireworks() {
|
||||
}
|
||||
|
||||
fireworksInterval = setInterval(() => {
|
||||
if (!document.body.contains(fireworkContainer)) { clearInterval(fireworksInterval); return; }
|
||||
const randomCount = Math.floor(Math.random() * maxFireworks) + minFireworks;
|
||||
for (let i = 0; i < randomCount; i++) {
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user