Move channelTitle to view

This commit is contained in:
Raphael Wickihalder 2022-05-30 07:27:41 +02:00
parent e4db2d401b
commit 8b1927b5dd
No known key found for this signature in database
GPG key ID: 05179BB92383243D
2 changed files with 2 additions and 13 deletions

View file

@ -40,16 +40,6 @@ const select = (state, props) => {
const uri = props.uri; const uri = props.uri;
const claim = selectClaimForUri(state, uri); const claim = selectClaimForUri(state, uri);
const { signing_channel } = claim || {};
let channelTitle = null;
if (signing_channel) {
const { value, name } = signing_channel;
if (value && value.title) {
channelTitle = value.title;
} else {
channelTitle = name;
}
}
// TODO: eventually this should be received from DB and not local state (https://github.com/lbryio/lbry-desktop/issues/6796) // TODO: eventually this should be received from DB and not local state (https://github.com/lbryio/lbry-desktop/issues/6796)
const position = urlParams.get('t') !== null ? urlParams.get('t') : selectContentPositionForUri(state, uri); const position = urlParams.get('t') !== null ? urlParams.get('t') : selectContentPositionForUri(state, uri);
@ -84,7 +74,6 @@ const select = (state, props) => {
videoPlaybackRate: selectClientSetting(state, SETTINGS.VIDEO_PLAYBACK_RATE), videoPlaybackRate: selectClientSetting(state, SETTINGS.VIDEO_PLAYBACK_RATE),
thumbnail: selectThumbnailForUri(state, uri), thumbnail: selectThumbnailForUri(state, uri),
claim, claim,
channelTitle,
homepageData: selectHomepageData(state), homepageData: selectHomepageData(state),
authenticated: selectUserVerifiedEmail(state), authenticated: selectUserVerifiedEmail(state),
shareTelemetry: IS_WEB || selectDaemonSettings(state).share_usage_data, shareTelemetry: IS_WEB || selectDaemonSettings(state).share_usage_data,

View file

@ -75,7 +75,6 @@ type Props = {
doToast: ({ message: string, linkText: string, linkTarget: string }) => void, doToast: ({ message: string, linkText: string, linkTarget: string }) => void,
doSetContentHistoryItem: (uri: string) => void, doSetContentHistoryItem: (uri: string) => void,
doClearContentHistoryUri: (uri: string) => void, doClearContentHistoryUri: (uri: string) => void,
channelTitle: string,
}; };
/* /*
@ -93,7 +92,6 @@ function VideoViewer(props: Props) {
thumbnail, thumbnail,
position, position,
claim, claim,
channelTitle,
uri, uri,
muted, muted,
volume, volume,
@ -130,6 +128,8 @@ function VideoViewer(props: Props) {
const adApprovedChannelIds = homepageData ? getAllIds(homepageData) : []; const adApprovedChannelIds = homepageData ? getAllIds(homepageData) : [];
const claimId = claim && claim.claim_id; const claimId = claim && claim.claim_id;
const channelClaimId = claim && claim.signing_channel && claim.signing_channel.claim_id; const channelClaimId = claim && claim.signing_channel && claim.signing_channel.claim_id;
const channelTitle =
(claim && claim.signing_channel && claim.signing_channel.value && claim.signing_channel.value.title) || '';
const isAudio = contentType.includes('audio'); const isAudio = contentType.includes('audio');
const forcePlayer = FORCE_CONTENT_TYPE_PLAYER.includes(contentType); const forcePlayer = FORCE_CONTENT_TYPE_PLAYER.includes(contentType);
const { const {