use correct url for recommended content on vanity claims

This commit is contained in:
Sean Yesmunt 2018-08-21 00:23:52 -04:00
parent a3bcd19c24
commit f60531183d

View file

@ -97,10 +97,13 @@ class FilePage extends React.Component<Props> {
checkSubscription = (props: Props) => { checkSubscription = (props: Props) => {
if (props.subscriptions.find(sub => sub.channelName === props.claim.channel_name)) { if (props.subscriptions.find(sub => sub.channelName === props.claim.channel_name)) {
props.checkSubscription( props.checkSubscription(
buildURI({ buildURI(
contentName: props.claim.channel_name, {
claimId: props.claim.value.publisherSignature.certificateId, contentName: props.claim.channel_name,
}, false) claimId: props.claim.value.publisherSignature.certificateId,
},
false
)
); );
} }
}; };
@ -157,6 +160,13 @@ class FilePage extends React.Component<Props> {
editUri = buildURI(uriObject); editUri = buildURI(uriObject);
} }
let recommendedUri = uri;
if (!recommendedUri.includes('#')) {
// at a vanity url
// append the claim ID so we can properly strip it out of reccomended videos
recommendedUri = `${recommendedUri}#${claim.claim_id}`;
}
return ( return (
<Page forContent> <Page forContent>
<section className="content__wrapper"> <section className="content__wrapper">
@ -241,7 +251,7 @@ class FilePage extends React.Component<Props> {
</div> </div>
</div> </div>
</section> </section>
<RecommendedContent uri={uri} /> <RecommendedContent uri={recommendedUri} />
</Page> </Page>
); );
} }