From b26b143c316f1c2c3cc3a0b9cc96e1bef1c96287 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 27 Aug 2020 16:16:23 -0400 Subject: [PATCH] fix comment redirect for unauth users --- ui/component/commentCreate/view.jsx | 22 +--------------------- ui/component/commentsList/view.jsx | 14 ++------------ 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index c437ec982..32294f60c 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -9,12 +9,10 @@ import { FormField, Form } from 'component/common/form'; import Button from 'component/button'; import ChannelSelection from 'component/selectChannel'; import usePersistedState from 'effects/use-persisted-state'; -import I18nMessage from 'component/i18nMessage'; import { FF_MAX_CHARS_IN_COMMENT } from 'constants/form-field'; import { useHistory } from 'react-router'; type Props = { - commentingEnabled: boolean, uri: string, claim: StreamClaim, openModal: (id: string, { onCommentAcknowledge: () => void }) => void, @@ -27,17 +25,7 @@ type Props = { }; export function CommentCreate(props: Props) { - const { - commentingEnabled, - createComment, - claim, - openModal, - channels, - parentId, - onDoneReplying, - onCancelReplying, - isNested, - } = props; + const { createComment, claim, openModal, channels, parentId, onDoneReplying, onCancelReplying, isNested } = props; const { push } = useHistory(); const { claim_id: claimId } = claim; const isReply = !!parentId; @@ -100,14 +88,6 @@ export function CommentCreate(props: Props) { useEffect(() => setCharCount(commentValue.length), [commentValue]); - if (!commentingEnabled) { - return ( - }}> - Please %sign_in_link% to comment. - - ); - } - if (!hasChannels) { return (
push(`/$/${PAGES.CHANNEL_NEW}`)}> diff --git a/ui/component/commentsList/view.jsx b/ui/component/commentsList/view.jsx index ee775931b..b97b6206d 100644 --- a/ui/component/commentsList/view.jsx +++ b/ui/component/commentsList/view.jsx @@ -15,20 +15,10 @@ type Props = { myChannels: ?Array, isFetchingComments: boolean, linkedComment: any, - commentingEnabled: boolean, }; function CommentList(props: Props) { - const { - fetchComments, - uri, - comments, - claimIsMine, - myChannels, - isFetchingComments, - linkedComment, - commentingEnabled, - } = props; + const { fetchComments, uri, comments, claimIsMine, myChannels, isFetchingComments, linkedComment } = props; const linkedCommentId = linkedComment && linkedComment.comment_id; const [start] = React.useState(0); @@ -93,7 +83,7 @@ function CommentList(props: Props) { title={{__('Comments')}} actions={ <> - {commentingEnabled && } + {!isFetchingComments && hasNoComments &&
{__('Be the first to comment!')}
}
    {isFetchingComments && (