File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
packages/svelte/src/motion Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -230,9 +230,6 @@ export class Tween {
230230 set ( value , options ) {
231231 set ( this . #target, value ) ;
232232
233- let previous_task = this . #task;
234-
235- let started = false ;
236233 let {
237234 delay = 0 ,
238235 duration = 400 ,
@@ -241,10 +238,7 @@ export class Tween {
241238 } = { ...this . #defaults, ...options } ;
242239
243240 if ( duration === 0 ) {
244- if ( previous_task ) {
245- previous_task . abort ( ) ;
246- previous_task = null ;
247- }
241+ this . #task?. abort ( ) ;
248242 set ( this . #current, value ) ;
249243 return Promise . resolve ( ) ;
250244 }
@@ -253,6 +247,8 @@ export class Tween {
253247
254248 /** @type {(t: number) => T } */
255249 let fn ;
250+ let started = false ;
251+ let previous_task = this . #task;
256252
257253 this . #task = loop ( ( now ) => {
258254 if ( now < start ) {
You can’t perform that action at this time.
0 commit comments