Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Jan 18, 2024
1 parent 327cd91 commit d4d2ef6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/svelte/src/internal/client/transitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,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();
Expand Down

0 comments on commit d4d2ef6

Please sign in to comment.