diff --git a/app/scenes/Document/components/Comments.tsx b/app/scenes/Document/components/Comments.tsx index 5277daece2..4e064536a5 100644 --- a/app/scenes/Document/components/Comments.tsx +++ b/app/scenes/Document/components/Comments.tsx @@ -126,9 +126,65 @@ function Comments() { prevThreadCount.current = threads.length; }, [sortOption.type, threads.length, viewingResolved]); - if (!document || !isEditorInitialized) { - return null; - } + const content = + !document || !isEditorInitialized ? null : ( + <> + + + {hasComments ? ( + threads.map((thread) => ( + + )) + ) : ( + + + {viewingResolved + ? t("No resolved comments") + : t("No comments yet")} + + + )} + {showJumpToRecentBtn && ( + + + + {t("New comments")}  + + + + + )} + + + + {(!focusedComment || isMobile) && can.comment && !viewingResolved && ( + + )} + + + ); return ( ui.set({ commentsExpanded: false })} scrollable={false} > - - - {hasComments ? ( - threads.map((thread) => ( - - )) - ) : ( - - - {viewingResolved - ? t("No resolved comments") - : t("No comments yet")} - - - )} - {showJumpToRecentBtn && ( - - - - {t("New comments")}  - - - - - )} - - - - {(!focusedComment || isMobile) && can.comment && !viewingResolved && ( - - )} - + {content} ); }