mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fixed 'show more' status while initial comment load
This commit is contained in:
parent
585f9b57cb
commit
60fdced237
2 changed files with 20 additions and 9 deletions
|
@ -34,15 +34,21 @@ const NodeComments: FC<IProps> = memo(({ order }) => {
|
|||
const groupped: ICommentGroup[] = useGrouppedComments(
|
||||
comments,
|
||||
order,
|
||||
lastSeenCurrent ?? undefined
|
||||
lastSeenCurrent ?? undefined,
|
||||
);
|
||||
|
||||
const more = useMemo(
|
||||
() =>
|
||||
hasMore && <div className={styles.more}>
|
||||
<LoadMoreButton isLoading={isLoadingMore} onClick={onLoadMoreComments} />
|
||||
</div>,
|
||||
[hasMore, onLoadMoreComments, isLoadingMore]
|
||||
hasMore &&
|
||||
!isLoading && (
|
||||
<div className={styles.more}>
|
||||
<LoadMoreButton
|
||||
isLoading={isLoadingMore}
|
||||
onClick={onLoadMoreComments}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
[hasMore, onLoadMoreComments, isLoadingMore, isLoading],
|
||||
);
|
||||
|
||||
if (!node?.id) {
|
||||
|
@ -53,7 +59,7 @@ const NodeComments: FC<IProps> = memo(({ order }) => {
|
|||
<div className={styles.wrap}>
|
||||
{order === 'DESC' && more}
|
||||
|
||||
{groupped.map(group => (
|
||||
{groupped.map((group) => (
|
||||
<Comment
|
||||
nodeId={node.id!}
|
||||
key={group.ids.join()}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue