Skip to content

Commit e738c06

Browse files
committed
fix?
1 parent 57ed936 commit e738c06

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/svelte/src/internal/client/context.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ export function push(props, runes = false, fn) {
167167
*/
168168
export function pop(component) {
169169
var context = /** @type {ComponentContext} */ (component_context);
170+
if (context.a) {
171+
return component ?? /** @type {T} */ ({});
172+
}
170173
var effects = context.e;
171174

172175
if (effects !== null && context.a === false) {

packages/svelte/src/internal/client/reactivity/async.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { DESTROYED } from '#client/constants';
44
import { DEV } from 'esm-env';
5-
import { component_context, is_runes, set_component_context } from '../context.js';
5+
import { component_context, is_runes, pop, set_component_context } from '../context.js';
66
import { get_pending_boundary } from '../dom/blocks/boundary.js';
77
import { invoke_error_boundary } from '../error-handling.js';
88
import {
@@ -195,14 +195,8 @@ export async function async_body(fn, is_component = false) {
195195
} finally {
196196
unsuspend();
197197
if (ctx !== null && ctx.e !== null) {
198-
var prev = component_context;
199-
var effects = ctx.e;
200-
set_component_context(ctx);
201-
for (var effect of effects) {
202-
create_user_effect(effect);
203-
}
204-
set_component_context(prev);
205-
ctx = prev = null;
198+
ctx.a = false;
199+
pop();
206200
}
207201
}
208202
}

0 commit comments

Comments
 (0)