From 45526a1823b6a59405fbb7d7a1cb98d487881348 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Wed, 23 Nov 2022 14:57:14 +0300 Subject: [PATCH 1/2] something --- src/utils/sortby.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/sortby.ts b/src/utils/sortby.ts index 4b03fdaee..fd6cb9c7 100644 --- a/src/utils/sortby.ts +++ b/src/utils/sortby.ts @@ -27,7 +27,7 @@ export const byLength = ( return 0 } -export const byStat = (metric: keyof Stat) => { +export const byStat = (metric: keyof Stat | keyof TopicStat) => { return (a, b) => { const x = (a?.stat && a.stat[metric]) || 0 const y = (b?.stat && b.stat[metric]) || 0 From fe066b7e3f10218caed3d2213b67673b0b37e50f Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Thu, 24 Nov 2022 10:33:16 +0300 Subject: [PATCH 2/2] fixed-comments --- src/components/Views/Article.tsx | 2 +- src/graphql/query/reactions-load-by.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/Views/Article.tsx b/src/components/Views/Article.tsx index d8679c69..ef73002e 100644 --- a/src/components/Views/Article.tsx +++ b/src/components/Views/Article.tsx @@ -14,7 +14,7 @@ interface ArticlePageProps { const ARTICLE_COMMENTS_PAGE_SIZE = 50 export const ArticleView = (props: ArticlePageProps) => { - const [getCommentsPage] = createSignal(1) + const [getCommentsPage] = createSignal(0) const [getIsCommentsLoading, setIsCommentsLoading] = createSignal(false) const { reactionsByShout, loadReactionsBy } = useReactionsStore({ reactions: props.reactions }) diff --git a/src/graphql/query/reactions-load-by.ts b/src/graphql/query/reactions-load-by.ts index 442496aa..b9da7a56 100644 --- a/src/graphql/query/reactions-load-by.ts +++ b/src/graphql/query/reactions-load-by.ts @@ -4,14 +4,18 @@ export default gql` query LoadReactions($by: ReactionBy!, $limit: Int, $offset: Int) { loadReactionsBy(by: $by, limit: $limit, offset: $offset) { id - shout { - title - } body - createdAt + range + replyTo { + id + # kind + } createdBy { name + slug + userpic } + createdAt updatedAt } }