diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx index 17496e02..4bee6c47 100644 --- a/src/components/Article/Comment.tsx +++ b/src/components/Article/Comment.tsx @@ -16,7 +16,7 @@ export default (props: { compact?: boolean }) => { const comment = createMemo(() => props.comment) - const body = createMemo(() => comment().body.toString().trim()) + const body = createMemo(() => (comment().body || '').trim()) const remove = () => { if (comment()?.id) { console.log('[comment] removing', comment().id) diff --git a/src/components/Views/Feed.tsx b/src/components/Views/Feed.tsx index 57c5bb3e..11c415e5 100644 --- a/src/components/Views/Feed.tsx +++ b/src/components/Views/Feed.tsx @@ -46,7 +46,7 @@ export const FeedView = () => { onMount(async () => { // load 5 recent comments overall - await loadReactionsBy({ by: {}, limit: 5, offset: 0 }) + await loadReactionsBy({ by: { comment: true }, limit: 5, offset: 0 }) // load recent shouts not only published ( visibility = community ) await loadMore() @@ -58,8 +58,8 @@ export const FeedView = () => { const userslug = session().user.slug await loadShouts({ filters: { author: userslug, visibility: 'authors' }, limit: 15 }) const collaborativeShouts = sortedArticles().filter((shout) => shout.visibility === 'authors') - // load recent reactions on collabs - await loadReactionsBy({ by: { shouts: [...collaborativeShouts], body: true }, limit: 5 }) + // load reactions on collaborativeShouts + await loadReactionsBy({ by: { shouts: [...collaborativeShouts] }, limit: 5 }) }) return ( diff --git a/src/graphql/query/reactions-load-by.ts b/src/graphql/query/reactions-load-by.ts index b9da7a56..90544861 100644 --- a/src/graphql/query/reactions-load-by.ts +++ b/src/graphql/query/reactions-load-by.ts @@ -6,10 +6,10 @@ export default gql` id body range - replyTo { - id - # kind - } + #replyTo { + # id + # kind + #} createdBy { name slug diff --git a/src/utils/apiClient.ts b/src/utils/apiClient.ts index 9c061e67..3138ee9f 100644 --- a/src/utils/apiClient.ts +++ b/src/utils/apiClient.ts @@ -208,7 +208,7 @@ export const apiClient = { }, getAuthor: async ({ slug }: { slug: string }): Promise => { const response = await publicGraphQLClient.query(authorBySlug, { slug }).toPromise() - console.error('getAuthor', response) + console.debug('getAuthor', response) return response.data.getAuthor }, getTopic: async ({ slug }: { slug: string }): Promise => {