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?
This commit is contained in:
infinite-persistence 2022-05-23 16:34:08 +08:00 committed by infinite-persistence
parent d207117e5d
commit cf700c3627
2 changed files with 12 additions and 11 deletions

View file

@ -8,7 +8,6 @@ import {
selectOdyseeMembershipForUri, selectOdyseeMembershipForUri,
} from 'redux/selectors/claims'; } from 'redux/selectors/claims';
import { doCommentUpdate, doCommentList } from 'redux/actions/comments'; import { doCommentUpdate, doCommentList } from 'redux/actions/comments';
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
import { doToast } from 'redux/actions/notifications'; import { doToast } from 'redux/actions/notifications';
import { doClearPlayingUri } from 'redux/actions/content'; import { doClearPlayingUri } from 'redux/actions/content';
import { import {
@ -35,7 +34,6 @@ const select = (state, props) => {
myChannelIds: selectMyClaimIdsRaw(state), myChannelIds: selectMyClaimIdsRaw(state),
claim: makeSelectClaimForUri(uri)(state), claim: makeSelectClaimForUri(uri)(state),
thumbnail: channel_url && selectThumbnailForUri(state, channel_url), thumbnail: channel_url && selectThumbnailForUri(state, channel_url),
channelIsBlocked: channel_url && makeSelectChannelIsMuted(channel_url)(state),
commentingEnabled: Boolean(selectUserVerifiedEmail(state)), commentingEnabled: Boolean(selectUserVerifiedEmail(state)),
othersReacts: selectOthersReactsForComment(state, reactionKey), othersReacts: selectOthersReactsForComment(state, reactionKey),
activeChannelClaim, activeChannelClaim,

View file

@ -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 // @flow
import * as ICONS from 'constants/icons'; import * as ICONS from 'constants/icons';
import * as PAGES from 'constants/pages'; import * as PAGES from 'constants/pages';
@ -46,7 +57,6 @@ type Props = {
clearPlayingUri: () => void, clearPlayingUri: () => void,
uri: string, uri: string,
claim: StreamClaim, 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 claimIsMine: boolean, // if you control the claim which this comment was posted on
updateComment: (string, string) => void, updateComment: (string, string) => void,
fetchReplies: (string, string, number, number, number) => void, fetchReplies: (string, string, number, number, number) => void,
@ -87,7 +97,6 @@ function CommentView(props: Props) {
clearPlayingUri, clearPlayingUri,
claim, claim,
uri, uri,
channelIsBlocked,
updateComment, updateComment,
fetchReplies, fetchReplies,
totalReplyPages, totalReplyPages,
@ -273,13 +282,7 @@ function CommentView(props: Props) {
> >
<div className="comment__thumbnail-wrapper"> <div className="comment__thumbnail-wrapper">
{authorUri ? ( {authorUri ? (
<ChannelThumbnail <ChannelThumbnail uri={authorUri} xsmall className="comment__author-thumbnail" checkMembership={false} />
uri={authorUri}
obscure={channelIsBlocked}
xsmall
className="comment__author-thumbnail"
checkMembership={false}
/>
) : ( ) : (
<ChannelThumbnail xsmall className="comment__author-thumbnail" checkMembership={false} /> <ChannelThumbnail xsmall className="comment__author-thumbnail" checkMembership={false} />
)} )}