diff --git a/src/components/Pages/AllAuthorsPage.tsx b/src/components/Pages/AllAuthorsPage.tsx index 01546c1b..959bc722 100644 --- a/src/components/Pages/AllAuthorsPage.tsx +++ b/src/components/Pages/AllAuthorsPage.tsx @@ -1,14 +1,27 @@ import { PageWrap } from '../_shared/PageWrap' import { AllAuthorsView } from '../Views/AllAuthors' import type { PageProps } from '../types' -import { ClientContainer } from '../_shared/ClientContainer' +import { createSignal, onMount, Show } from 'solid-js' +import { loadAllAuthors } from '../../stores/zine/authors' +import { Loading } from '../Loading' export const AllAuthorsPage = (props: PageProps) => { + const [isLoaded, setIsLoaded] = createSignal(Boolean(props.allAuthors)) + + onMount(async () => { + if (isLoaded()) { + return + } + + await loadAllAuthors() + setIsLoaded(true) + }) + return ( - + }> - + ) } diff --git a/src/components/Pages/AllTopicsPage.tsx b/src/components/Pages/AllTopicsPage.tsx index f030543a..6c2276b0 100644 --- a/src/components/Pages/AllTopicsPage.tsx +++ b/src/components/Pages/AllTopicsPage.tsx @@ -1,14 +1,27 @@ import { PageWrap } from '../_shared/PageWrap' import { AllTopicsView } from '../Views/AllTopics' import type { PageProps } from '../types' -import { ClientContainer } from '../_shared/ClientContainer' +import { createSignal, onMount, Show } from 'solid-js' +import { loadAllTopics } from '../../stores/zine/topics' +import { Loading } from '../Loading' export const AllTopicsPage = (props: PageProps) => { + const [isLoaded, setIsLoaded] = createSignal(Boolean(props.allTopics)) + + onMount(async () => { + if (isLoaded()) { + return + } + + await loadAllTopics() + setIsLoaded(true) + }) + return ( - + }> - + ) }