diff --git a/app/assets/javascripts/outfit-viewer.js b/app/assets/javascripts/outfit-viewer.js index 5187ffb3..243bff5c 100644 --- a/app/assets/javascripts/outfit-viewer.js +++ b/app/assets/javascripts/outfit-viewer.js @@ -1,6 +1,7 @@ class OutfitViewer extends HTMLElement { #internals; #isPlaying = true; // Track playing state internally (Safari CustomStateSet bug workaround) + #hasAnimations = false; // Track hasAnimations state internally (Safari CustomStateSet bug workaround) constructor() { super(); @@ -64,12 +65,12 @@ class OutfitViewer extends HTMLElement { this.querySelector("outfit-layer:state(has-animations)") !== null; // Check if state actually changed - const hadAnimations = this.#internals.states.has("has-animations"); - if (hasAnimations === hadAnimations) { + if (hasAnimations === this.#hasAnimations) { return; // No change, skip } // Update internal state + this.#hasAnimations = hasAnimations; if (hasAnimations) { this.#internals.states.add("has-animations"); } else {