mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #2208 from paulkaplan/fix-load-more
Use top level + replies count to control "Load More" comments button
This commit is contained in:
commit
f3b9826fd5
1 changed files with 2 additions and 1 deletions
|
@ -90,6 +90,7 @@ const PreviewPresentation = ({
|
|||
onUpdate
|
||||
}) => {
|
||||
const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : '';
|
||||
const loadedCommentCount = comments.length + Object.keys(replies).reduce((acc, id) => acc + replies[id].length, 0);
|
||||
return (
|
||||
<div className="preview">
|
||||
{!isShared && (
|
||||
|
@ -383,7 +384,7 @@ const PreviewPresentation = ({
|
|||
onRestore={onRestoreComment}
|
||||
/>
|
||||
))}
|
||||
{comments.length < projectInfo.stats.comments &&
|
||||
{loadedCommentCount < projectInfo.stats.comments &&
|
||||
<Button
|
||||
className="button load-more-button"
|
||||
onClick={onLoadMore}
|
||||
|
|
Loading…
Reference in a new issue