Remove active livestream condition

- meaningless since its supposed to be a permanent link either way
This commit is contained in:
Rafael 2022-05-13 13:46:49 -03:00 committed by Thomas Zarebczan
parent 26d7e9a2b6
commit 7c68fd1e61
3 changed files with 7 additions and 15 deletions

View file

@ -4,21 +4,17 @@ import { selectClaimForUri, selectTitleForUri } from 'redux/selectors/claims';
import SocialShare from './view';
import { selectUserInviteReferralCode, selectUser, selectUserInviteStatusFetched } from 'redux/selectors/user';
import { selectContentPositionForUri } from 'redux/selectors/content';
import { selectActiveLivestreamForChannel } from 'redux/selectors/livestream';
const select = (state, props) => {
const { uri } = props;
const claim = selectClaimForUri(state, uri);
const { claim_id: claimId } = claim || {};
return {
claim,
claim: selectClaimForUri(state, uri),
inviteStatusFetched: selectUserInviteStatusFetched(state),
referralCode: selectUserInviteReferralCode(state),
user: selectUser(state),
title: selectTitleForUri(state, uri),
position: selectContentPositionForUri(state, uri),
hasActiveLivestream: Boolean(selectActiveLivestreamForChannel(state, claimId)),
};
};

View file

@ -29,7 +29,6 @@ type Props = {
user: any,
position: number,
collectionId?: number,
hasActiveLivestream: boolean,
doFetchInviteStatus: (boolean) => void,
};
@ -43,7 +42,6 @@ function SocialShare(props: Props) {
webShareable,
position,
collectionId,
hasActiveLivestream,
doFetchInviteStatus,
} = props;
const [showEmbed, setShowEmbed] = React.useState(false);
@ -235,19 +233,17 @@ function SocialShare(props: Props) {
) : (
<>
<EmbedTextArea label={__('Embedded Latest Video Content')} claim={claim} newestType={PAGES.LATEST} />
{hasActiveLivestream && (
<EmbedTextArea label={__('Embedded Current Livestream')} claim={claim} newestType={PAGES.LIVE_NOW} />
)}
<EmbedTextArea label={__('Embedded Current Livestream')} claim={claim} newestType={PAGES.LIVE_NOW} />
</>
))}
{showClaimLinks && (
<div className="section">
{Boolean(isStream) && <CopyableText label={__('Download Link')} copyable={downloadUrl} />}
{Boolean(isChannel) && (
<CopyableText label={__('Latest Content Link')} copyable={generateNewestUrl(name, PAGES.LATEST)} />
)}
{Boolean(isChannel) && hasActiveLivestream && (
<CopyableText label={__('Current Livestream Link')} copyable={generateNewestUrl(name, PAGES.LIVE_NOW)} />
<>
<CopyableText label={__('Latest Content Link')} copyable={generateNewestUrl(name, PAGES.LATEST)} />
<CopyableText label={__('Current Livestream Link')} copyable={generateNewestUrl(name, PAGES.LIVE_NOW)} />
</>
)}
</div>
)}

View file

@ -80,7 +80,7 @@ export const selectActiveLivestreamForClaimId = createCachedSelector(
const activeLivestreamValues = Object.values(activeLivestreams);
// $FlowFixMe - https://github.com/facebook/flow/issues/2221
return activeLivestreamValues.find((v) => v.claimId === claimId) || null;
return activeLivestreamValues.find((v) => v?.claimId === claimId) || null;
}
)((state, claimId) => String(claimId));