This commit is contained in:
zeppi 2021-03-24 17:16:37 -04:00
parent f7ac301f6f
commit 967380d943
8 changed files with 12 additions and 30 deletions

View file

@ -1,6 +1,5 @@
// @flow
import { SHOW_ADS } from 'config';
import { LIVE_STREAM_CHANNEL_CLAIM_ID } from 'constants/livestream';
import * as CS from 'constants/claim_search';
import * as ICONS from 'constants/icons';
import React, { Fragment } from 'react';
@ -14,7 +13,6 @@ import LivestreamLink from 'component/livestreamLink';
import { Form, FormField } from 'component/common/form';
import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search';
import { lighthouse } from 'redux/actions/search';
import LivestreamLink from 'component/livestreamLink';
type Props = {
uri: string,
@ -105,8 +103,6 @@ function ChannelContent(props: Props) {
return (
<Fragment>
{claimId === LIVE_STREAM_CHANNEL_CLAIM_ID && <LivestreamLink />}
{!fetching && Boolean(claimsInChannel) && !channelIsBlocked && !channelIsBlackListed && (
<HiddenNsfwClaims uri={uri} />
)}

View file

@ -1,5 +1,4 @@
// @flow
import { LIVE_STREAM_TAG, LIVE_STREAM_CHANNEL_CLAIM_ID } from 'constants/livestream';
import type { Node } from 'react';
import React, { useEffect, forwardRef } from 'react';
import { NavLink, withRouter } from 'react-router-dom';
@ -129,12 +128,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
const abandoned = !isResolvingUri && !claim;
const shouldHideActions = hideActions || type === 'small' || type === 'tooltip';
const canonicalUrl = claim && claim.canonical_url;
const isLivestream =
claim &&
claim.signing_channel &&
claim.signing_channel.claim_id === LIVE_STREAM_CHANNEL_CLAIM_ID &&
claim.value.tags &&
claim.value.tags.includes(LIVE_STREAM_TAG);
let isValid = false;
if (uri) {
@ -217,7 +210,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
}
}, [isValid, uri, isResolvingUri, shouldFetch, resolveUri]);
if ((shouldHide && !showNullPlaceholder) || (isLivestream && hideLivestreamClaims)) {
if ((shouldHide && !showNullPlaceholder) || (!livestream && hideLivestreamClaims)) {
return null;
}

View file

@ -8,6 +8,7 @@ import {
doFileGet,
makeSelectChannelForClaimUri,
makeSelectClaimIsNsfw,
makeSelectClaimHasSource,
} from 'lbry-redux';
import { selectMutedChannels } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
@ -25,6 +26,7 @@ const select = (state, props) => ({
blockedChannelUris: selectMutedChannels(state),
showMature: selectShowMatureContent(state),
isMature: makeSelectClaimIsNsfw(props.uri)(state),
isLivestream: !makeSelectClaimHasSource(props.uri)(state),
});
const perform = (dispatch) => ({

View file

@ -1,5 +1,4 @@
// @flow
import { LIVE_STREAM_TAG, LIVE_STREAM_CHANNEL_CLAIM_ID } from 'constants/livestream';
import React from 'react';
import classnames from 'classnames';
import { NavLink, withRouter } from 'react-router-dom';
@ -42,6 +41,7 @@ type Props = {
showMature: boolean,
showHiddenByUser?: boolean,
hideLivestreamClaims?: boolean,
isLivestream: boolean,
};
function ClaimPreviewTile(props: Props) {
@ -63,18 +63,13 @@ function ClaimPreviewTile(props: Props) {
showMature,
showHiddenByUser,
hideLivestreamClaims,
isLivestream,
} = props;
const isRepost = claim && claim.repost_channel_url;
const shouldFetch = claim === undefined;
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
const canonicalUrl = claim && claim.canonical_url;
const navigateUrl = formatLbryUrlForWeb(canonicalUrl || uri || '/');
const isLivestream =
claim &&
claim.signing_channel &&
claim.signing_channel.claim_id === LIVE_STREAM_CHANNEL_CLAIM_ID &&
claim.value.tags &&
claim.value.tags.includes(LIVE_STREAM_TAG);
const navLinkProps = {
to: navigateUrl,

View file

@ -334,7 +334,7 @@ function PublishFile(props: Props) {
className={disabled || balance === 0 ? 'card--disabled' : ''}
title={
<div>
{__('Upload') || header}
{header}
{publishing && <Spinner type={'small'} />}
{inProgress && (
<div>

View file

@ -415,6 +415,7 @@ function PublishForm(props: Props) {
<Button
key={String(modeName)}
icon={modeName}
iconSize={18}
label={__(MODE_TO_I18N_STR[String(modeName)] || '---')}
button="alt"
onClick={() => {

View file

@ -9,7 +9,7 @@ import {
SETTINGS,
makeSelectTagInClaimOrChannelForUri,
makeSelectClaimIsMine,
makeSelectClaimForUri,
makeSelectClaimHasSource,
} from 'lbry-redux';
import { makeSelectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
import { selectShowMatureContent, makeSelectClientSetting } from 'redux/selectors/settings';
@ -34,8 +34,8 @@ const select = (state, props) => {
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
videoTheaterMode: makeSelectClientSetting(SETTINGS.VIDEO_THEATER_MODE)(state),
commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
claim: makeSelectClaimForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
isLivestream: !makeSelectClaimHasSource(props.uri)(state),
};
};

View file

@ -1,5 +1,4 @@
// @flow
import { LIVE_STREAM_CHANNEL_CLAIM_ID, LIVE_STREAM_TAG } from 'constants/livestream';
import * as PAGES from 'constants/pages';
import * as React from 'react';
import classnames from 'classnames';
@ -35,6 +34,7 @@ type Props = {
claim: ?Claim,
claimIsMine: boolean,
commentsDisabled: boolean,
isLivestream: boolean,
};
function FilePage(props: Props) {
@ -51,19 +51,14 @@ function FilePage(props: Props) {
linkedComment,
setPrimaryUri,
videoTheaterMode,
claim,
claimIsMine,
commentsDisabled,
isLivestream,
} = props;
const cost = costInfo ? costInfo.cost : null;
const hasFileInfo = fileInfo !== undefined;
const isMarkdown = renderMode === RENDER_MODES.MARKDOWN;
const isLivestream =
claim &&
claim.signing_channel &&
claim.signing_channel.claim_id === LIVE_STREAM_CHANNEL_CLAIM_ID &&
claim.value.tags &&
claim.value.tags.includes(LIVE_STREAM_TAG);
React.useEffect(() => {
// always refresh file info when entering file page to see if we have the file