Merge pull request #294 from lbryio/fix-falseAnonChans

fix falsely anonymous channels in publishes
This commit is contained in:
jessopb 2020-03-26 16:31:57 -04:00 committed by GitHub
commit 7e093c31f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

11
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;
return includePrefix ? canonicalUrl : canonicalUrl.slice('lbry://'.length);
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;
return includePrefix ? canonicalUrl : canonicalUrl.slice('lbry://'.length);
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);
}
}
);