hotixes-2

This commit is contained in:
tonyrewin 2022-11-26 04:46:34 +03:00
parent 236806c79e
commit 27514b495c
4 changed files with 9 additions and 9 deletions

View File

@ -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)

View File

@ -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 (

View File

@ -6,10 +6,10 @@ export default gql`
id
body
range
replyTo {
id
# kind
}
#replyTo {
# id
# kind
#}
createdBy {
name
slug

View File

@ -208,7 +208,7 @@ export const apiClient = {
},
getAuthor: async ({ slug }: { slug: string }): Promise<Author> => {
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<Topic> => {