From cf700c3627d43d03e3f5eeb9d864923a0778705a Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Mon, 23 May 2022 16:34:08 +0800 Subject: [PATCH] Comment: remove the muted prop Since the comment list is pre-filtered and includes the muted list, I think this prop will never be true? --- ui/component/comment/index.js | 2 -- ui/component/comment/view.jsx | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ui/component/comment/index.js b/ui/component/comment/index.js index f1a14c664..2fe2d724e 100644 --- a/ui/component/comment/index.js +++ b/ui/component/comment/index.js @@ -8,7 +8,6 @@ import { selectOdyseeMembershipForUri, } from 'redux/selectors/claims'; import { doCommentUpdate, doCommentList } from 'redux/actions/comments'; -import { makeSelectChannelIsMuted } from 'redux/selectors/blocked'; import { doToast } from 'redux/actions/notifications'; import { doClearPlayingUri } from 'redux/actions/content'; import { @@ -35,7 +34,6 @@ const select = (state, props) => { myChannelIds: selectMyClaimIdsRaw(state), claim: makeSelectClaimForUri(uri)(state), thumbnail: channel_url && selectThumbnailForUri(state, channel_url), - channelIsBlocked: channel_url && makeSelectChannelIsMuted(channel_url)(state), commentingEnabled: Boolean(selectUserVerifiedEmail(state)), othersReacts: selectOthersReactsForComment(state, reactionKey), activeChannelClaim, diff --git a/ui/component/comment/view.jsx b/ui/component/comment/view.jsx index a442c43d9..ebdcc6a07 100644 --- a/ui/component/comment/view.jsx +++ b/ui/component/comment/view.jsx @@ -1,3 +1,14 @@ +/** + * Comment component. + * + * Notes: + * - Filtration is not done at this component level. Comments are filtered + * in the selector through `filterComments()`. This saves the need to handle + * it from the render loop, but also means we cannot render it differently + * (e.g. displaying as "Comment has been blocked") since the component doesn't + * see it. + */ + // @flow import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; @@ -46,7 +57,6 @@ type Props = { clearPlayingUri: () => void, uri: string, claim: StreamClaim, - channelIsBlocked: boolean, // if the channel is blacklisted in the app claimIsMine: boolean, // if you control the claim which this comment was posted on updateComment: (string, string) => void, fetchReplies: (string, string, number, number, number) => void, @@ -87,7 +97,6 @@ function CommentView(props: Props) { clearPlayingUri, claim, uri, - channelIsBlocked, updateComment, fetchReplies, totalReplyPages, @@ -273,13 +282,7 @@ function CommentView(props: Props) { >
{authorUri ? ( - + ) : ( )}