From bbfb0a23aceca34d014330b035147d7f6c4fd13b Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 18 Jan 2024 14:48:56 +0000 Subject: [PATCH] tweak --- packages/svelte/src/internal/client/transitions.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/svelte/src/internal/client/transitions.js b/packages/svelte/src/internal/client/transitions.js index f6bdf9f460..fabf343a8d 100644 --- a/packages/svelte/src/internal/client/transitions.js +++ b/packages/svelte/src/internal/client/transitions.js @@ -444,15 +444,13 @@ function create_transition(dom, init, direction, effect) { const css_fn = payload.css; const easing_fn = payload.easing || linear; const keyframes = create_keyframes(easing_fn, css_fn, duration, direction, true); - const current_animation = /** @type {Animation} */ (animation); - const effect = current_animation.effect; - if (effect != null) { + if (/** @type {Animation} */ (animation).effect != null) { // If we have an existing animation, we need to pause it and create a new animation // with the new frames. animation.pause(); create_animation(); // @ts-ignore - effect.setKeyframes(keyframes); + animation.effect.setKeyframes(keyframes); } } /** @type {Animation | TickAnimation} */ (animation).reverse();