fix(island): 🐛 prevent displaying fallback when Suspense
is loaded
This commit is contained in:
parent
f2c8b145e6
commit
72281ae551
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue