Fix comment disabling on MD (#685) (#7431)

Also restore reactions
This is only an internal tag

Co-authored-by: Thomas Zarebczan <tzarebczan@users.noreply.github.com>
This commit is contained in:
jessopb 2022-01-21 12:54:43 -05:00 committed by GitHub
parent fc3ddf01b1
commit 18c3bbe6e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 12 deletions

View file

@ -1,13 +1,7 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { import { selectClaimIsMine, selectClaimForUri, selectHasChannels } from 'redux/selectors/claims';
selectClaimIsMine,
selectClaimForUri,
selectHasChannels,
makeSelectTagInClaimOrChannelForUri,
} from 'redux/selectors/claims';
import { makeSelectStreamingUrlForUri, makeSelectFileInfoForUri } from 'redux/selectors/file_info'; import { makeSelectStreamingUrlForUri, makeSelectFileInfoForUri } from 'redux/selectors/file_info';
import { doPrepareEdit } from 'redux/actions/publish'; import { doPrepareEdit } from 'redux/actions/publish';
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
import { selectCostInfoForUri } from 'lbryinc'; import { selectCostInfoForUri } from 'lbryinc';
import { doSetPlayingUri, doPlayUri } from 'redux/actions/content'; import { doSetPlayingUri, doPlayUri } from 'redux/actions/content';
import { doToast } from 'redux/actions/notifications'; import { doToast } from 'redux/actions/notifications';
@ -26,7 +20,6 @@ const select = (state, props) => {
renderMode: makeSelectFileRenderModeForUri(props.uri)(state), renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
costInfo: selectCostInfoForUri(state, props.uri), costInfo: selectCostInfoForUri(state, props.uri),
hasChannels: selectHasChannels(state), hasChannels: selectHasChannels(state),
reactionsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state), streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
}; };
}; };

View file

@ -29,7 +29,6 @@ type Props = {
renderMode: string, renderMode: string,
hasChannels: boolean, hasChannels: boolean,
hideRepost?: boolean, hideRepost?: boolean,
reactionsDisabled: boolean,
download: (string) => void, download: (string) => void,
streamingUrl: ?string, streamingUrl: ?string,
}; };
@ -46,7 +45,6 @@ function FileActions(props: Props) {
prepareEdit, prepareEdit,
hasChannels, hasChannels,
hideRepost, hideRepost,
reactionsDisabled,
} = props; } = props;
const { const {
push, push,
@ -80,7 +78,7 @@ function FileActions(props: Props) {
const lhsSection = ( const lhsSection = (
<> <>
{ENABLE_FILE_REACTIONS && !reactionsDisabled && <FileReactions uri={uri} />} {ENABLE_FILE_REACTIONS && <FileReactions uri={uri} />}
<ClaimSupportButton uri={uri} fileAction /> <ClaimSupportButton uri={uri} fileAction />
<ClaimCollectionAddButton uri={uri} fileAction /> <ClaimCollectionAddButton uri={uri} fileAction />
{!hideRepost && <ClaimRepostButton uri={uri} claim={claim} hasChannels={hasChannels} />} {!hideRepost && <ClaimRepostButton uri={uri} claim={claim} hasChannels={hasChannels} />}

View file

@ -196,7 +196,7 @@ function FilePage(props: Props) {
{!collection && !isMarkdown && !videoTheaterMode && <RecommendedContent uri={uri} />} {!collection && !isMarkdown && !videoTheaterMode && <RecommendedContent uri={uri} />}
{isMarkdown && ( {isMarkdown && (
<div className="file-page__post-comments"> <div className="file-page__post-comments">
<CommentsList uri={uri} linkedCommentId={linkedCommentId} commentsAreExpanded /> {!commentsDisabled && <CommentsList uri={uri} linkedCommentId={linkedCommentId} commentsAreExpanded />}
</div> </div>
)} )}
</Page> </Page>