File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,13 @@ function capture() {
7373 var previous_effect = active_effect ;
7474 var previous_reaction = active_reaction ;
7575 var previous_component_context = component_context ;
76+ var previous_batch = current_batch ;
7677
7778 return function restore ( ) {
7879 set_active_effect ( previous_effect ) ;
7980 set_active_reaction ( previous_reaction ) ;
8081 set_component_context ( previous_component_context ) ;
82+ previous_batch ?. activate ( ) ;
8183
8284 if ( DEV ) {
8385 set_from_async_derived ( null ) ;
@@ -176,8 +178,8 @@ export function unset_context() {
176178 * @param {() => Promise<void> } fn
177179 */
178180export async function async_body ( fn ) {
179- const unsuspend = suspend ( ) ;
180- const active = /** @type {Effect } */ ( active_effect ) ;
181+ var unsuspend = suspend ( ) ;
182+ var active = /** @type {Effect } */ ( active_effect ) ;
181183
182184 try {
183185 await fn ( ) ;
Original file line number Diff line number Diff line change @@ -680,6 +680,10 @@ export function suspend() {
680680 batch . decrement ( ) ;
681681 }
682682
683+ if ( batch === current_batch ) {
684+ batch . deactivate ( ) ;
685+ }
686+
683687 unset_context ( ) ;
684688 } ;
685689}
You can’t perform that action at this time.
0 commit comments