This commit is contained in:
picklesrus 2021-06-07 15:31:20 -04:00
parent 993dd36aa5
commit 1afbe4ad79
2 changed files with 8 additions and 5 deletions

View file

@ -602,8 +602,9 @@ const PreviewPresentation = ({
author={comment.author}
canDelete={canDeleteComments}
canDeleteWithoutConfirm={isAdmin}
canReply=
{isLoggedIn && projectInfo.comments_allowed && isShared}
canReply={
isLoggedIn && projectInfo.comments_allowed && isShared
}
canReport={isLoggedIn}
canRestore={canRestoreComments}
content={comment.content}
@ -615,7 +616,9 @@ const PreviewPresentation = ({
moreRepliesToLoad={comment.moreRepliesToLoad}
parentId={comment.parent_id}
postURI={`/proxy/comments/project/${projectId}`}
replies={replies && replies[comment.id] ? replies[comment.id] : []}
replies={
replies && replies[comment.id] ? replies[comment.id] : []
}
visibility={comment.visibility}
onAddComment={onAddComment}
onDelete={onDeleteComment}

View file

@ -903,6 +903,7 @@ Preview.propTypes = {
isAdmin: PropTypes.bool,
isEditable: PropTypes.bool,
isLoggedIn: PropTypes.bool,
isProjectCommentsGloballyEnabled: PropTypes.bool,
isNewScratcher: PropTypes.bool,
isScratcher: PropTypes.bool,
isShared: PropTypes.bool,
@ -983,8 +984,7 @@ const mapStateToProps = state => {
const isEditable = isLoggedIn &&
(authorUsername === state.session.session.user.username ||
state.permissions.admin === true);
const haveSession = state.session.session.flags;
const areCommentsOn = haveSession && selectProjectCommentsGloballyEnabled(state);
const areCommentsOn = state.session.session.flags && selectProjectCommentsGloballyEnabled(state);
// if we don't have projectInfo, assume it's shared until we know otherwise