don't add scroll listener until comments have been fetched
This commit is contained in:
parent
00c05437ca
commit
fc2a79242e
1 changed files with 2 additions and 2 deletions
|
@ -111,14 +111,14 @@ function CommentList(props: Props) {
|
|||
}
|
||||
}
|
||||
|
||||
if (moreBelow && spinnerRef && spinnerRef.current) {
|
||||
if (!isFetchingComments && moreBelow && spinnerRef && spinnerRef.current) {
|
||||
window.addEventListener('scroll', handleCommentScroll);
|
||||
}
|
||||
|
||||
return () => window.removeEventListener('scroll', handleCommentScroll);
|
||||
}, [moreBelow, handleMoreBelow, spinnerRef]);
|
||||
|
||||
function prepareComments(arrayOfComments, linkedComment) {
|
||||
function prepareComments(arrayOfComments, linkedComment, isFetchingComments) {
|
||||
let orderedComments = [];
|
||||
|
||||
if (linkedComment) {
|
||||
|
|
Loading…
Reference in a new issue