fix logic for single comment effect

This commit is contained in:
Eric Rosenbaum 2021-06-17 14:05:25 -04:00
parent a5800cb8fb
commit 1605e23d5f

View file

@ -50,11 +50,13 @@ const StudioComments = ({
parseInt(window.location.hash.replace(commentHashPrefix, ''), 10));
useEffect(() => {
if (singleCommentId) {
handleLoadSingleComment(singleCommentId);
return;
if (comments.length === 0 && hasFetchedSession) {
if (singleCommentId) {
handleLoadSingleComment(singleCommentId);
} else {
handleLoadMoreComments();
}
}
if (comments.length === 0 && hasFetchedSession) handleLoadMoreComments();
}, [comments.length === 0, hasFetchedSession, singleCommentId]);
const handleSeeAllComments = () => {