profile-hotfix

This commit is contained in:
Untone 2024-05-27 22:13:55 +03:00 committed by dog
parent 9ba7bfada8
commit 1a2d197e0c

View File

@ -66,7 +66,7 @@ export const AuthorView = (props: Props) => {
const { authors, profile, topics } = appdata const { authors, profile, topics } = appdata
setFollowers(myFollowers) setFollowers(myFollowers)
setAuthor(profile) setAuthor(profile)
setFollowing([...authors, ...topics]) setFollowing([...(authors || []), ...(topics || [])])
} }
} }
}) })
@ -75,6 +75,7 @@ export const AuthorView = (props: Props) => {
const bioWrapperRef: { current: HTMLDivElement } = { current: null } const bioWrapperRef: { current: HTMLDivElement } = { current: null }
const fetchData = async (slug: string) => { const fetchData = async (slug: string) => {
if (author()?.stat.followers || author()?.stat.followers === (followers() || [])?.length) return
try { try {
const [subscriptionsResult, followersResult, authorResult] = await Promise.all([ const [subscriptionsResult, followersResult, authorResult] = await Promise.all([
apiClient.getAuthorFollows({ slug }), apiClient.getAuthorFollows({ slug }),
@ -215,7 +216,7 @@ export const AuthorView = (props: Props) => {
slug: props.authorSlug, slug: props.authorSlug,
})} })}
> >
{t('Profile')} {t('About')}
</a> </a>
</li> </li>
</ul> </ul>