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 compact?: boolean
}) => { }) => {
const comment = createMemo(() => props.comment) const comment = createMemo(() => props.comment)
const body = createMemo(() => comment().body.toString().trim()) const body = createMemo(() => (comment().body || '').trim())
const remove = () => { const remove = () => {
if (comment()?.id) { if (comment()?.id) {
console.log('[comment] removing', comment().id) console.log('[comment] removing', comment().id)

View File

@ -46,7 +46,7 @@ export const FeedView = () => {
onMount(async () => { onMount(async () => {
// load 5 recent comments overall // 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 ) // load recent shouts not only published ( visibility = community )
await loadMore() await loadMore()
@ -58,8 +58,8 @@ export const FeedView = () => {
const userslug = session().user.slug const userslug = session().user.slug
await loadShouts({ filters: { author: userslug, visibility: 'authors' }, limit: 15 }) await loadShouts({ filters: { author: userslug, visibility: 'authors' }, limit: 15 })
const collaborativeShouts = sortedArticles().filter((shout) => shout.visibility === 'authors') const collaborativeShouts = sortedArticles().filter((shout) => shout.visibility === 'authors')
// load recent reactions on collabs // load reactions on collaborativeShouts
await loadReactionsBy({ by: { shouts: [...collaborativeShouts], body: true }, limit: 5 }) await loadReactionsBy({ by: { shouts: [...collaborativeShouts] }, limit: 5 })
}) })
return ( return (

View File

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

View File

@ -208,7 +208,7 @@ export const apiClient = {
}, },
getAuthor: async ({ slug }: { slug: string }): Promise<Author> => { getAuthor: async ({ slug }: { slug: string }): Promise<Author> => {
const response = await publicGraphQLClient.query(authorBySlug, { slug }).toPromise() const response = await publicGraphQLClient.query(authorBySlug, { slug }).toPromise()
console.error('getAuthor', response) console.debug('getAuthor', response)
return response.data.getAuthor return response.data.getAuthor
}, },
getTopic: async ({ slug }: { slug: string }): Promise<Topic> => { getTopic: async ({ slug }: { slug: string }): Promise<Topic> => {