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

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

Loading…
Cancel
Save