defer-fixed
This commit is contained in:
parent
e29188726c
commit
284c728b61
|
@ -1,4 +1,4 @@
|
||||||
// biome-ignore lint/style/useNodejsImportProtocol:
|
// biome-ignore lint/style/useNodejsImportProtocol: it works like this
|
||||||
import { Buffer } from 'buffer'
|
import { Buffer } from 'buffer'
|
||||||
|
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
|
|
|
@ -47,13 +47,15 @@ export const EditPage = () => {
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
const shoutId = window.location.pathname.split('/').pop()
|
const shoutId = window.location.pathname.split('/').pop()
|
||||||
const shoutIdFromUrl = Number.parseInt(shoutId ?? '0', 10)
|
const shoutIdFromUrl = Number.parseInt(shoutId ?? '0', 10)
|
||||||
|
console.debug(`editing shout ${shoutIdFromUrl}`)
|
||||||
if (shoutIdFromUrl) setShoutId(shoutIdFromUrl)
|
if (shoutIdFromUrl) setShoutId(shoutIdFromUrl)
|
||||||
})
|
})
|
||||||
|
|
||||||
createEffect(
|
createEffect(
|
||||||
on(
|
on([session, shout, shoutId], async ([ses, sh, shid]) => {
|
||||||
[session, shout, shoutId],
|
console.debug(`editing session ${ses}`)
|
||||||
async ([ses, sh, shid]) => {
|
console.debug(`editing shout_id ${shid}`)
|
||||||
|
console.debug(`editing shout ${sh}`)
|
||||||
if (ses?.user && !sh && shid) {
|
if (ses?.user && !sh && shid) {
|
||||||
const { shout: loadedShout, error } = await apiClient.getMyShout(shid)
|
const { shout: loadedShout, error } = await apiClient.getMyShout(shid)
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -62,9 +64,7 @@ export const EditPage = () => {
|
||||||
setShout(loadedShout)
|
setShout(loadedShout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
{ defer: true },
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const title = createMemo(() => {
|
const title = createMemo(() => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user