create-fx-fix

This commit is contained in:
Untone 2024-03-07 13:03:19 +03:00
parent d7f00cd962
commit a59ee6260c

View File

@ -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 { AuthGuard } from '../components/AuthGuard'
import { Loading } from '../components/_shared/Loading' import { Loading } from '../components/_shared/Loading'
@ -24,8 +24,9 @@ export const EditPage = () => {
const [shout, setShout] = createSignal<Shout>(null) const [shout, setShout] = createSignal<Shout>(null)
onMount(async () => { createEffect(
const { shout: loadedShout, error } = await apiClient.getMyShout(shoutId()) on(shoutId, async (shout_id) => {
const { shout: loadedShout, error } = await apiClient.getMyShout(shout_id)
console.log(loadedShout) console.log(loadedShout)
if (error) { if (error) {
await snackbar?.showSnackbar({ type: 'error', body: t('This content is not published yet') }) await snackbar?.showSnackbar({ type: 'error', body: t('This content is not published yet') })
@ -33,7 +34,8 @@ export const EditPage = () => {
} else { } else {
setShout(loadedShout) setShout(loadedShout)
} }
}) }),
)
const title = createMemo(() => { const title = createMemo(() => {
if (!shout()) { if (!shout()) {