diff --git a/src/features/loupe/CommentsPopover.jsx b/src/features/loupe/CommentsPopover.jsx
index 37b67cf4..12d27262 100644
--- a/src/features/loupe/CommentsPopover.jsx
+++ b/src/features/loupe/CommentsPopover.jsx
@@ -97,12 +97,7 @@ const StyledAddCommentButton = styled(Button, {
marginRight: '0',
});
-export const CommentsPopover = ({
- onClose,
- comments,
- imageId,
- onChangeActionMenu
-}) => {
+export const CommentsPopover = ({ onClose, comments, imageId, onChangeActionMenu }) => {
const dispatch = useDispatch();
const commentsLoading = useSelector(selectCommentsLoading);
const [addCommentText, setAddCommentText] = useState('');
@@ -129,19 +124,19 @@ export const CommentsPopover = ({
- {comments.length > 0 && (
+ {comments?.length > 0 && (
{comments.map((comment) => (
-
))}
)}
-
+
setAddCommentText(e.target.value)}
diff --git a/src/features/loupe/ImageReviewToolbar.jsx b/src/features/loupe/ImageReviewToolbar.jsx
index a7cde121..f6daa6a0 100644
--- a/src/features/loupe/ImageReviewToolbar.jsx
+++ b/src/features/loupe/ImageReviewToolbar.jsx
@@ -187,7 +187,7 @@ const ImageReviewToolbar = ({
if (!isCommentsActionMenuOpen) {
setIsCommentsPopoverOpen(false);
}
- }
+ };
return (
@@ -312,7 +312,7 @@ const ImageReviewToolbar = ({
setIsCommentsPopoverOpen(true)}>
- {image.comments.length > 0 && {image.comments.length}}
+ {image.comments?.length > 0 && {image.comments?.length}}
@@ -321,9 +321,9 @@ const ImageReviewToolbar = ({
- onClickOutsideComments()}
>