From 01eac8a16dca07f995c0c69b6cd9acc413ffd69f Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 7 Dec 2023 22:29:15 +0300 Subject: [PATCH] maintopic-fix --- src/components/Article/FullArticle.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index 205f54cf..fd263978 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -70,7 +70,9 @@ export const FullArticle = (props: Props) => { const formattedDate = createMemo(() => formatDate(new Date(props.article.created_at * 1000))) - const mainTopic = createMemo(() => (props.article.topics.length > 0 ? props.article.topics[0] : null)) + const mainTopic = createMemo(() => + props.article.topics.length > 0 ? props.article.topics.reverse()[0] : null, + ) const canEdit = () => props.article.authors?.some((a) => a.slug === author()?.slug)