diff --git a/islands/Suspens.tsx b/islands/Suspens.tsx index d2e2c80..779f8f3 100644 --- a/islands/Suspens.tsx +++ b/islands/Suspens.tsx @@ -27,8 +27,10 @@ export default function Suspense( }, ) { const displayed = useSignal(loader) + let loaded = false signal?.addEventListener('abort', () => { + if (loaded) return try { signal.throwIfAborted() } catch (error) { @@ -40,6 +42,7 @@ export default function Suspense( .then((element) => { if (signal?.aborted) return displayed.value = element + loaded = true }) .catch((error) => { if (signal?.aborted) return