another fix

aaa
Dominic Gannaway 8 months ago
parent 278c49056d
commit ad1c214b29

@ -1,6 +1,6 @@
/** @import { Effect, TemplateNode, } from '#client' */ /** @import { Effect, TemplateNode, } from '#client' */
import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT, INERT } from '../../constants.js'; import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT } from '../../constants.js';
import { import {
block, block,
branch, branch,
@ -81,8 +81,6 @@ export function boundary(node, props, boundary_fn) {
var is_creating_fallback = false; var is_creating_fallback = false;
const render_snippet = (/** @type { () => void } */ snippet_fn) => { const render_snippet = (/** @type { () => void } */ snippet_fn) => {
// Render the snippet in a microtask
queue_micro_task(() => {
with_boundary(boundary, () => { with_boundary(boundary, () => {
is_creating_fallback = true; is_creating_fallback = true;
@ -97,7 +95,6 @@ export function boundary(node, props, boundary_fn) {
reset_is_throwing_error(); reset_is_throwing_error();
is_creating_fallback = false; is_creating_fallback = false;
}); });
});
}; };
// @ts-ignore We re-use the effect's fn property to avoid allocation of an additional field // @ts-ignore We re-use the effect's fn property to avoid allocation of an additional field
@ -203,6 +200,7 @@ export function boundary(node, props, boundary_fn) {
} }
if (failed) { if (failed) {
queue_micro_task(() => {
render_snippet(() => { render_snippet(() => {
failed( failed(
anchor, anchor,
@ -210,6 +208,7 @@ export function boundary(node, props, boundary_fn) {
() => reset () => reset
); );
}); });
});
} }
}; };

Loading…
Cancel
Save