mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-24 08:08:18 -05:00
fix logic for single comment effect
This commit is contained in:
parent
a5800cb8fb
commit
1605e23d5f
1 changed files with 6 additions and 4 deletions
|
@ -50,11 +50,13 @@ const StudioComments = ({
|
||||||
parseInt(window.location.hash.replace(commentHashPrefix, ''), 10));
|
parseInt(window.location.hash.replace(commentHashPrefix, ''), 10));
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (singleCommentId) {
|
if (comments.length === 0 && hasFetchedSession) {
|
||||||
handleLoadSingleComment(singleCommentId);
|
if (singleCommentId) {
|
||||||
return;
|
handleLoadSingleComment(singleCommentId);
|
||||||
|
} else {
|
||||||
|
handleLoadMoreComments();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (comments.length === 0 && hasFetchedSession) handleLoadMoreComments();
|
|
||||||
}, [comments.length === 0, hasFetchedSession, singleCommentId]);
|
}, [comments.length === 0, hasFetchedSession, singleCommentId]);
|
||||||
|
|
||||||
const handleSeeAllComments = () => {
|
const handleSeeAllComments = () => {
|
||||||
|
|
Loading…
Reference in a new issue