pull/16197/head
Rich Harris 6 months ago
parent b7c39956ac
commit 2620a2189f

@ -228,6 +228,8 @@ export class Boundary {
});
}
this.ran = false;
this.#main_effect = this.#run(() => {
this.#is_creating_fallback = false;
@ -238,6 +240,8 @@ export class Boundary {
}
});
this.ran = true;
if (this.#pending_count > 0) {
this.#show_pending_snippet();
}

@ -124,13 +124,13 @@ export function async_derived(fn, location) {
var restore = capture();
var fork = active_fork;
var ran = boundary.ran;
if (should_suspend) {
if (fork !== null) {
fork.increment();
} else {
// if nearest pending boundary is not ready, attach to the boundary
if (!ran) {
boundary.increment();
} else {
fork?.increment();
}
}
@ -144,10 +144,10 @@ export function async_derived(fn, location) {
from_async_derived = null;
if (should_suspend) {
if (fork !== null) {
fork.decrement();
} else {
if (!ran) {
boundary.decrement();
} else {
fork?.decrement();
}
}

Loading…
Cancel
Save