only show pending block the first time

aaa
Rich Harris 7 months ago
parent 99998926e4
commit ad58a702dd

@ -81,6 +81,8 @@ export function boundary(node, props, boundary_fn) {
var hydrate_open = hydrate_node;
var is_creating_fallback = false;
var inited = false;
var render_snippet = (/** @type { () => void } */ snippet_fn) => {
with_boundary(boundary, () => {
is_creating_fallback = true;
@ -103,6 +105,8 @@ export function boundary(node, props, boundary_fn) {
let pending = /** @type {(anchor: Node) => void} */ (props.pending);
if (input === ASYNC_INCREMENT) {
if (inited) return true;
if (async_count++ === 0) {
queue_boundary_micro_task(() => {
if (async_effect || !boundary_effect) {
@ -143,8 +147,13 @@ export function boundary(node, props, boundary_fn) {
}
if (input === ASYNC_DECREMENT) {
if (inited) return true;
if (--async_count === 0) {
queue_boundary_micro_task(() => {
if (async_count === 0) {
inited = true;
}
if (!async_effect) {
return;
}

@ -848,7 +848,7 @@ function process_effects(effect, collected_effects) {
if (check_dirtiness(current_effect)) {
update_effect(current_effect);
if ((flags & IS_ASYNC) !== 0 && !suspended) {
suspended = true;
// suspended = true;
}
}
} catch (error) {

Loading…
Cancel
Save