topics-fmt-fix

This commit is contained in:
tony 2024-08-26 15:26:00 +03:00
parent 0748aa342c
commit 1c2b53cfe8

View File

@ -19,7 +19,13 @@ export default (props: RouteSectionProps<{ topics: Topic[] }>) => {
const { t } = useLocalize()
const topics = createAsync<Topic[]>(async () => props.data.topics || (await fetchData()) || [])
const { addTopics } = useTopics()
createEffect(on(() => topics() || [], (ttt: Topic[]) => ttt && addTopics(ttt), { defer: true}))
createEffect(
on(
() => topics() || [],
(ttt: Topic[]) => ttt && addTopics(ttt),
{ defer: true }
)
)
return (
<PageLayout
withPadding={true}