Only apply Staked Levels to Comments (allow it in Posts)

Blocking videos and images was too limiting, plus the system was intended to block spammy comments in the first place.
This commit is contained in:
infinite-persistence 2021-04-09 01:59:22 +08:00 committed by Sean Yesmunt
parent 5bc462927a
commit fb839b92ef
5 changed files with 7 additions and 17 deletions

View file

@ -1,10 +1,9 @@
import { connect } from 'react-redux';
import { makeSelectMetadataItemForUri, makeSelectClaimForUri, makeSelectStakedLevelForChannelUri } from 'lbry-redux';
import { makeSelectMetadataItemForUri, makeSelectClaimForUri } from 'lbry-redux';
import ChannelAbout from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
stakedLevel: makeSelectStakedLevelForChannelUri(props.uri)(state),
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),

View file

@ -17,7 +17,6 @@ type Props = {
email: ?string,
website: ?string,
languages: Array<string>,
stakedLevel?: number,
};
const formatEmail = (email: string) => {
@ -30,7 +29,7 @@ const formatEmail = (email: string) => {
};
function ChannelAbout(props: Props) {
const { claim, uri, description, email, website, languages, stakedLevel } = props;
const { claim, uri, description, email, website, languages } = props;
const claimId = claim && claim.claim_id;
return (
@ -41,7 +40,7 @@ function ChannelAbout(props: Props) {
<>
<label>{__('Description')}</label>
<div className="media__info-text media__info-text--constrained">
<MarkdownPreview content={description} stakedLevel={stakedLevel} />
<MarkdownPreview content={description} />
</div>
</>
)}

View file

@ -6,8 +6,6 @@ import {
makeSelectDownloadPathForUri,
makeSelectStreamingUrlForUri,
SETTINGS,
makeSelectStakedLevelForChannelUri,
makeSelectChannelForClaimUri,
} from 'lbry-redux';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { makeSelectFileRenderModeForUri, makeSelectFileExtensionForUri } from 'redux/selectors/content';
@ -15,11 +13,9 @@ import FileRender from './view';
const select = (state, props) => {
const autoplay = props.embedded ? false : makeSelectClientSetting(SETTINGS.AUTOPLAY)(state);
const channelUri = makeSelectChannelForClaimUri(props.uri)(state);
return {
currentTheme: makeSelectClientSetting(SETTINGS.THEME)(state),
claim: makeSelectClaimForUri(props.uri)(state),
stakedLevel: makeSelectStakedLevelForChannelUri(channelUri)(state),
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
contentType: makeSelectContentTypeForUri(props.uri)(state),
downloadPath: makeSelectDownloadPathForUri(props.uri)(state),

View file

@ -35,7 +35,6 @@ type Props = {
thumbnail: string,
desktopPlayStartTime?: number,
className?: string,
stakedLevel?: number,
};
class FileRender extends React.PureComponent<Props> {
@ -79,7 +78,6 @@ class FileRender extends React.PureComponent<Props> {
uri,
renderMode,
desktopPlayStartTime,
stakedLevel,
} = this.props;
const source = streamingUrl;
@ -104,7 +102,7 @@ class FileRender extends React.PureComponent<Props> {
<DocumentViewer
source={{
// @if TARGET='app'
file: options => fs.createReadStream(downloadPath, options),
file: (options) => fs.createReadStream(downloadPath, options),
// @endif
stream: source,
fileExtension,
@ -112,7 +110,6 @@ class FileRender extends React.PureComponent<Props> {
}}
renderMode={renderMode}
theme={currentTheme}
stakedLevel={stakedLevel}
/>
);
case RENDER_MODES.DOCX:
@ -134,7 +131,7 @@ class FileRender extends React.PureComponent<Props> {
<ComicBookViewer
source={{
// @if TARGET='app'
file: options => fs.createReadStream(downloadPath, options),
file: (options) => fs.createReadStream(downloadPath, options),
// @endif
stream: source,
}}

View file

@ -15,7 +15,6 @@ type Props = {
stream: string,
contentType: string,
},
stakedLevel?: number,
};
type State = {
@ -76,11 +75,11 @@ class DocumentViewer extends React.PureComponent<Props, State> {
renderDocument() {
const { content } = this.state;
const { source, theme, renderMode, stakedLevel } = this.props;
const { source, theme, renderMode } = this.props;
const { contentType } = source;
return renderMode === RENDER_MODES.MARKDOWN ? (
<MarkdownPreview content={content} isMarkdownPost promptLinks stakedLevel={stakedLevel} />
<MarkdownPreview content={content} isMarkdownPost promptLinks />
) : (
<CodeViewer value={content} contentType={contentType} theme={theme} />
);