improve load question

This commit is contained in:
“spicecat” 2022-07-26 09:59:07 -04:00
commit 4b536558fc

View file

@ -24,7 +24,9 @@ export function AnswersList() {
.then(({ answers }) => sortByPoints(answers).map(answer => ({ ...answer, question_id })))
.catch(() => []);
return <PaginatedList {...{ count, Component: Answer, getData, noData: false }} />;
return (
question_id && <PaginatedList {...{ count, Component: Answer, getData, noData: false }} />
);
}
export function CommentsList() {
@ -35,5 +37,7 @@ export function CommentsList() {
.then(({ comments }) => comments.map(comment => ({ ...comment, question_id })))
.catch(() => []);
return <PaginatedList {...{ count, Component: Comment, getData, noData: false }} />;
return (
question_id && <PaginatedList {...{ count, Component: Comment, getData, noData: false }} />
);
}