Skip to content

Commit

Permalink
Hide comments from deleted channels (#2940)
Browse files Browse the repository at this point in the history
* Remove unused prop

* Hide comments from deleted channels

## Ticket
2934 comments for deleted channel still shown

## Old behavior
- `UriIndicator` will display the deleted channel name as "[Removed]".
- Comment text remains displayed.

## Root cause
2554 (1f60d01) removed `UriIndicator` and tries to display the best channel name format based on `comment` object data, which is populated even if the channel was deleted.

## Change
I think there was a reason why we decided to show the comment instead of hiding it, but I can't recall. Maybe it's so that the Total shown tallies, or some pagination issue.

Anyway, just hide it for now as suggested in the ticket. If an issue is found, we can try to restore the old behavior.
  • Loading branch information
infinite-persistence authored Aug 24, 2023
1 parent c6ff164 commit f0da607
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/component/comment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const select = (state, props) => {
claim,
commentingEnabled: Boolean(selectUserVerifiedEmail(state)),
othersReacts: selectOthersReactsForComment(state, reactionKey),
activeChannelClaim,
hasChannels: selectHasChannels(state),
playingUri: selectPlayingUri(state),
stakedLevel: selectStakedLevelForChannelUri(state, channel_url),
isCommenterChannelDeleted: selectClaimForUri(state, channel_url) === null,
linkedCommentAncestors: selectFetchedCommentAncestors(state),
totalReplyPages: makeSelectTotalReplyPagesForParentId(comment_id)(state),
odyseeMembership: selectOdyseeMembershipForChannelId(state, channel_id) || '',
Expand Down
7 changes: 6 additions & 1 deletion ui/component/comment/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ type StateProps = {|
linkedCommentAncestors: { [string]: Array<string> },
totalReplyPages: number,
repliesFetching: boolean,
activeChannelClaim: ?ChannelClaim,
claim: StreamClaim,
authorTitle: ?string,
channelAge?: any,
Expand All @@ -88,6 +87,7 @@ type StateProps = {|
commentingEnabled: boolean,
playingUri: PlayingUri,
stakedLevel: number,
isCommenterChannelDeleted: boolean,
|};

type DispatchProps = {|
Expand Down Expand Up @@ -125,6 +125,7 @@ function CommentView(props: Props & StateProps & DispatchProps) {
othersReacts,
playingUri,
stakedLevel,
isCommenterChannelDeleted,
supportDisabled,
setQuickReply,
quickReply,
Expand Down Expand Up @@ -309,6 +310,10 @@ function CommentView(props: Props & StateProps & DispatchProps) {
[ROUGH_HEADER_HEIGHT, isMobile]
);

if (isCommenterChannelDeleted) {
return null;
}

return (
<li
className={classnames('comment', {
Expand Down

0 comments on commit f0da607

Please sign in to comment.