fix falsely anonymous channels in publishes #294
2 changed files with 16 additions and 6 deletions
9
dist/bundle.es.js
vendored
9
dist/bundle.es.js
vendored
|
@ -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 => {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue