refactoring fixes

This commit is contained in:
Igor Lobanov 2022-11-21 01:12:20 +01:00
parent 995a7be94e
commit c1cc1a3ad9
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,10 @@ export const AuthorCard = (props: AuthorCardProps) => {
() => session()?.news?.authors?.some((u) => u === props.author.slug) || false () => session()?.news?.authors?.some((u) => u === props.author.slug) || false
) )
const canFollow = createMemo(() => !props.hideFollow && session()?.user?.slug !== props.author.slug) const canFollow = createMemo(() => !props.hideFollow && session()?.user?.slug !== props.author.slug)
const bio = () => props.caption || props.author.bio || t('Our regular contributor') const bio = createMemo(() => {
return props.caption || props.author.bio || t('Our regular contributor')
})
const name = () => { const name = () => {
return props.author.name === 'Дискурс' && locale() !== 'ru' return props.author.name === 'Дискурс' && locale() !== 'ru'
? 'Discours' ? 'Discours'

View File

@ -7,7 +7,7 @@ import { PRERENDERED_ARTICLES_COUNT } from '../../../components/Views/Author'
const slug = Astro.params.slug.toString() const slug = Astro.params.slug.toString()
const shouts = await apiClient.getShouts({ filters: { author: slug }, limit: PRERENDERED_ARTICLES_COUNT }) const shouts = await apiClient.getShouts({ filters: { author: slug }, limit: PRERENDERED_ARTICLES_COUNT })
const author = await apiClient.getAuthorsBy({ by: { slug } }) const author = await apiClient.getAuthor({ slug })
const { pathname, search } = Astro.url const { pathname, search } = Astro.url
initRouter(pathname, search) initRouter(pathname, search)