get-unrated-fix
This commit is contained in:
parent
5310260969
commit
1af7ba520e
|
@ -30,12 +30,7 @@ const DialogCard = (props: DialogProps) => {
|
||||||
() => props.members && props.members.filter((member: ChatMember) => member.id !== props.ownId),
|
() => props.members && props.members.filter((member: ChatMember) => member.id !== props.ownId),
|
||||||
)
|
)
|
||||||
|
|
||||||
const names = createMemo(
|
const names = createMemo<string>(() => (companions() || []).map((companion) => companion.name).join(', '))
|
||||||
() =>
|
|
||||||
companions()
|
|
||||||
?.map((companion) => companion.name)
|
|
||||||
.join(', '),
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Show when={props.members}>
|
<Show when={props.members}>
|
||||||
|
|
|
@ -136,13 +136,15 @@ export const FeedView = (props: Props) => {
|
||||||
return visibility
|
return visibility
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { session } = useSession()
|
||||||
const {
|
const {
|
||||||
actions: { loadReactionsBy },
|
actions: { loadReactionsBy },
|
||||||
} = useReactions()
|
} = useReactions()
|
||||||
|
|
||||||
const loadUnratedArticles = async () => {
|
const loadUnratedArticles = async () => {
|
||||||
const result = await apiClient.getUnratedShouts(UNRATED_ARTICLES_COUNT)
|
if (session()) {
|
||||||
setUnratedArticles(result)
|
const result = await apiClient.getUnratedShouts(UNRATED_ARTICLES_COUNT)
|
||||||
|
setUnratedArticles(result)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadTopComments = async () => {
|
const loadTopComments = async () => {
|
||||||
|
@ -153,10 +155,9 @@ export const FeedView = (props: Props) => {
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
loadMore()
|
loadMore()
|
||||||
// eslint-disable-next-line promise/catch-or-return
|
// 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(() => {
|
createEffect(() => {
|
||||||
if (session()?.access_token && !unratedArticles()) {
|
if (session()?.access_token && !unratedArticles()) {
|
||||||
loadUnratedArticles()
|
loadUnratedArticles()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user