create-fx-fix
This commit is contained in:
parent
d7f00cd962
commit
a59ee6260c
|
@ -1,4 +1,4 @@
|
|||
import { Show, Suspense, createMemo, createSignal, lazy, onMount } from 'solid-js'
|
||||
import { Show, Suspense, createEffect, createMemo, createSignal, lazy, on, onMount } from 'solid-js'
|
||||
|
||||
import { AuthGuard } from '../components/AuthGuard'
|
||||
import { Loading } from '../components/_shared/Loading'
|
||||
|
@ -24,8 +24,9 @@ export const EditPage = () => {
|
|||
|
||||
const [shout, setShout] = createSignal<Shout>(null)
|
||||
|
||||
onMount(async () => {
|
||||
const { shout: loadedShout, error } = await apiClient.getMyShout(shoutId())
|
||||
createEffect(
|
||||
on(shoutId, async (shout_id) => {
|
||||
const { shout: loadedShout, error } = await apiClient.getMyShout(shout_id)
|
||||
console.log(loadedShout)
|
||||
if (error) {
|
||||
await snackbar?.showSnackbar({ type: 'error', body: t('This content is not published yet') })
|
||||
|
@ -33,7 +34,8 @@ export const EditPage = () => {
|
|||
} else {
|
||||
setShout(loadedShout)
|
||||
}
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
||||
const title = createMemo(() => {
|
||||
if (!shout()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user