fix falsely anonymous channels in publishes #294

Merged
jessopb merged 1 commit from fix-falseAnonChans into master 2020-03-26 21:31:58 +01:00
2 changed files with 16 additions and 6 deletions

9
dist/bundle.es.js vendored
View file

@ -2354,12 +2354,17 @@ const makeSelectFirstRecommendedFileForUri = uri => reselect.createSelector(make
// accepts a regular claim uri lbry://something
// returns the channel uri that created this claim lbry://@channel
const makeSelectChannelForClaimUri = (uri, includePrefix = false) => reselect.createSelector(makeSelectClaimForUri(uri), claim => {
if (!claim || !claim.signing_channel || !claim.signing_channel.canonical_url) {
if (!claim || !claim.signing_channel) {
return null;
}
const { canonical_url: canonicalUrl } = claim.signing_channel;
const { canonical_url: canonicalUrl, permanent_url: permanentUrl } = claim.signing_channel;
if (canonicalUrl) {
return includePrefix ? canonicalUrl : canonicalUrl.slice('lbry://'.length);
} else {
return includePrefix ? permanentUrl : permanentUrl.slice('lbry://'.length);
}
});
const makeSelectTagsForUri = uri => reselect.createSelector(makeSelectMetadataForUri(uri), metadata => {

View file

@ -576,12 +576,17 @@ export const makeSelectChannelForClaimUri = (uri: string, includePrefix: boolean
createSelector(
makeSelectClaimForUri(uri),
(claim: ?Claim) => {
if (!claim || !claim.signing_channel || !claim.signing_channel.canonical_url) {
if (!claim || !claim.signing_channel) {
return null;
}
const { canonical_url: canonicalUrl } = claim.signing_channel;
const { canonical_url: canonicalUrl, permanent_url: permanentUrl } = claim.signing_channel;
if (canonicalUrl) {
return includePrefix ? canonicalUrl : canonicalUrl.slice('lbry://'.length);
} else {
return includePrefix ? permanentUrl : permanentUrl.slice('lbry://'.length);
}
}
);