get-unrated-fix
Some checks failed
deploy / test (push) Successful in 1m5s
deploy / Update templates on Mailgun (push) Failing after 5s

This commit is contained in:
Untone 2024-01-18 15:52:02 +03:00
parent 5310260969
commit 1af7ba520e
2 changed files with 7 additions and 11 deletions

View File

@ -30,12 +30,7 @@ const DialogCard = (props: DialogProps) => {
() => props.members && props.members.filter((member: ChatMember) => member.id !== props.ownId),
)
const names = createMemo(
() =>
companions()
?.map((companion) => companion.name)
.join(', '),
)
const names = createMemo<string>(() => (companions() || []).map((companion) => companion.name).join(', '))
return (
<Show when={props.members}>

View File

@ -136,13 +136,15 @@ export const FeedView = (props: Props) => {
return visibility
})
const { session } = useSession()
const {
actions: { loadReactionsBy },
} = useReactions()
const loadUnratedArticles = async () => {
const result = await apiClient.getUnratedShouts(UNRATED_ARTICLES_COUNT)
setUnratedArticles(result)
if (session()) {
const result = await apiClient.getUnratedShouts(UNRATED_ARTICLES_COUNT)
setUnratedArticles(result)
}
}
const loadTopComments = async () => {
@ -153,10 +155,9 @@ export const FeedView = (props: Props) => {
onMount(() => {
loadMore()
// eslint-disable-next-line promise/catch-or-return
Promise.all([loadUnratedArticles(), loadTopComments()]).finally(() => setIsRightColumnLoaded(true))
Promise.all([loadTopComments()]).finally(() => setIsRightColumnLoaded(true))
})
const { session } = useSession()
createEffect(() => {
if (session()?.access_token && !unratedArticles()) {
loadUnratedArticles()