fixes: recommended content + crashes

This commit is contained in:
Thomas Zarebczan 2019-08-30 12:28:36 -04:00 committed by Sean Yesmunt
parent 805b29721b
commit 7a6e8ddabc
4 changed files with 8 additions and 10 deletions

8
dist/bundle.es.js vendored
View file

@ -1045,7 +1045,7 @@ function buildURI(UrlObj, includeProto = true, protoDefault = 'lbry://') {
const { claimId, claimName, contentName } = deprecatedParts; const { claimId, claimName, contentName } = deprecatedParts;
if (!claimName && !channelName && !streamName) { if (!claimName && !channelName && !streamName) {
throw new Error(__("'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.")); console.error(__("'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url."));
} }
const formattedChannelName = channelName && (channelName.startsWith('@') ? channelName : `@${channelName}`); const formattedChannelName = channelName && (channelName.startsWith('@') ? channelName : `@${channelName}`);
@ -1724,8 +1724,8 @@ const makeSelectRecommendedContentForUri = uri => reselect.createSelector(makeSe
let recommendedContent; let recommendedContent;
if (claim) { if (claim) {
// If we are at a vanity uri, build the full uri so we can properly filter // always grab full URL - this can change once search returns canonical
const currentUri = atVanityURI ? buildURI({ streamClaimId: claim.claim_id, streamName: claim.name }) : uri; const currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name });
const { title } = claim.value; const { title } = claim.value;
@ -2874,7 +2874,7 @@ const selectIsResolvingPublishUris = reselect.createSelector(selectState$5, sele
const { isChannel } = parseURI(uri); const { isChannel } = parseURI(uri);
let isResolvingShortUri; let isResolvingShortUri;
if (isChannel) { if (isChannel && name) {
const shortUri = buildURI({ streamName: name }); const shortUri = buildURI({ streamName: name });
isResolvingShortUri = resolvingUris.includes(shortUri); isResolvingShortUri = resolvingUris.includes(shortUri);
} }

View file

@ -199,7 +199,7 @@ export function buildURI(
} }
if (!claimName && !channelName && !streamName) { if (!claimName && !channelName && !streamName) {
throw new Error( console.error(
__( __(
"'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url." "'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url."
) )

View file

@ -456,10 +456,8 @@ export const makeSelectRecommendedContentForUri = (uri: string) =>
let recommendedContent; let recommendedContent;
if (claim) { if (claim) {
// If we are at a vanity uri, build the full uri so we can properly filter // always grab full URL - this can change once search returns canonical
const currentUri = atVanityURI const currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name });
? buildURI({ streamClaimId: claim.claim_id, streamName: claim.name })
: uri;
const { title } = claim.value; const { title } = claim.value;

View file

@ -84,7 +84,7 @@ export const selectIsResolvingPublishUris = createSelector(
const { isChannel } = parseURI(uri); const { isChannel } = parseURI(uri);
let isResolvingShortUri; let isResolvingShortUri;
if (isChannel) { if (isChannel && name) {
const shortUri = buildURI({ streamName: name }); const shortUri = buildURI({ streamName: name });
isResolvingShortUri = resolvingUris.includes(shortUri); isResolvingShortUri = resolvingUris.includes(shortUri);
} }