Skip to content

Commit ad1c214

Browse files
committed
another fix
1 parent 278c490 commit ad1c214

File tree

1 file changed

+20
-21
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+20
-21
lines changed

packages/svelte/src/internal/client/dom/blocks/boundary.js

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @import { Effect, TemplateNode, } from '#client' */
22

3-
import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT, INERT } from '../../constants.js';
3+
import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT } from '../../constants.js';
44
import {
55
block,
66
branch,
@@ -81,22 +81,19 @@ export function boundary(node, props, boundary_fn) {
8181
var is_creating_fallback = false;
8282

8383
const render_snippet = (/** @type { () => void } */ snippet_fn) => {
84-
// Render the snippet in a microtask
85-
queue_micro_task(() => {
86-
with_boundary(boundary, () => {
87-
is_creating_fallback = true;
84+
with_boundary(boundary, () => {
85+
is_creating_fallback = true;
8886

89-
try {
90-
boundary_effect = branch(() => {
91-
snippet_fn();
92-
});
93-
} catch (error) {
94-
handle_error(error, boundary, null, boundary.ctx);
95-
}
87+
try {
88+
boundary_effect = branch(() => {
89+
snippet_fn();
90+
});
91+
} catch (error) {
92+
handle_error(error, boundary, null, boundary.ctx);
93+
}
9694

97-
reset_is_throwing_error();
98-
is_creating_fallback = false;
99-
});
95+
reset_is_throwing_error();
96+
is_creating_fallback = false;
10097
});
10198
};
10299

@@ -203,12 +200,14 @@ export function boundary(node, props, boundary_fn) {
203200
}
204201

205202
if (failed) {
206-
render_snippet(() => {
207-
failed(
208-
anchor,
209-
() => error,
210-
() => reset
211-
);
203+
queue_micro_task(() => {
204+
render_snippet(() => {
205+
failed(
206+
anchor,
207+
() => error,
208+
() => reset
209+
);
210+
});
212211
});
213212
}
214213
};

0 commit comments

Comments
 (0)