suspense-fix
This commit is contained in:
parent
4b1d21b15e
commit
18b7b22270
|
@ -1,6 +1,3 @@
|
||||||
// biome-ignore lint/style/useNodejsImportProtocol: it works like this
|
|
||||||
import { Buffer } from 'buffer'
|
|
||||||
|
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { Show } from 'solid-js'
|
import { Show } from 'solid-js'
|
||||||
|
|
||||||
|
@ -12,7 +9,12 @@ import { DropArea } from '../../_shared/DropArea'
|
||||||
|
|
||||||
import styles from './AudioUploader.module.scss'
|
import styles from './AudioUploader.module.scss'
|
||||||
|
|
||||||
window.Buffer = Buffer
|
try {
|
||||||
|
// biome-ignore lint/style/useNodejsImportProtocol: it works like this
|
||||||
|
window.Buffer = (await import('buffer')).Buffer
|
||||||
|
} catch (_e) {
|
||||||
|
window.Buffer = (await import('node:buffer')).Buffer
|
||||||
|
}
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
class?: string
|
class?: string
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Show, createEffect, createMemo, createSignal, lazy, on, onMount } from 'solid-js'
|
import { Show, Suspense, createEffect, createMemo, createSignal, lazy, on, onMount } from 'solid-js'
|
||||||
|
|
||||||
import { AuthGuard } from '../components/AuthGuard'
|
import { AuthGuard } from '../components/AuthGuard'
|
||||||
import { Loading } from '../components/_shared/Loading'
|
import { Loading } from '../components/_shared/Loading'
|
||||||
|
@ -74,9 +74,11 @@ export const EditPage = () => {
|
||||||
return (
|
return (
|
||||||
<PageLayout title={title()}>
|
<PageLayout title={title()}>
|
||||||
<AuthGuard>
|
<AuthGuard>
|
||||||
<Show when={shout()} fallback={<Loading />}>
|
<Suspense fallback={<Loading />}>
|
||||||
<EditView shout={shout() as Shout} />
|
<Show when={shout()} fallback={<Loading />}>
|
||||||
</Show>
|
<EditView shout={shout() as Shout} />
|
||||||
|
</Show>
|
||||||
|
</Suspense>
|
||||||
</AuthGuard>
|
</AuthGuard>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user