author loading fix

This commit is contained in:
Igor Lobanov 2022-11-25 10:38:26 +01:00
parent 75c3c33d3b
commit 539c0454ff
2 changed files with 3 additions and 2 deletions

View File

@ -38,7 +38,7 @@ export const AuthorPage = (props: PageProps) => {
return ( return (
<PageWrap> <PageWrap>
<Show when={isLoaded()} fallback={<Loading />}> <Show when={isLoaded()} fallback={<Loading />}>
<AuthorView author={props.author} shouts={props.shouts} /> <AuthorView author={props.author} shouts={props.shouts} authorSlug={slug()} />
</Show> </Show>
</PageWrap> </PageWrap>
) )

View File

@ -17,6 +17,7 @@ import { splitToPages } from '../../utils/splitToPages'
type AuthorProps = { type AuthorProps = {
shouts: Shout[] shouts: Shout[]
author: Author author: Author
authorSlug: string
// FIXME author topics from server // FIXME author topics from server
// topics: Topic[] // topics: Topic[]
} }
@ -36,7 +37,7 @@ export const AuthorView = (props: AuthorProps) => {
const { topicsByAuthor } = useTopicsStore() const { topicsByAuthor } = useTopicsStore()
const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false) const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false)
const author = createMemo(() => authorEntities()[props.author.slug]) const author = createMemo(() => authorEntities()[props.authorSlug])
const { searchParams, changeSearchParam } = useRouter<AuthorPageSearchParams>() const { searchParams, changeSearchParam } = useRouter<AuthorPageSearchParams>()
const loadMore = async () => { const loadMore = async () => {