fix search result uri building and empty array reduce warning
This commit is contained in:
parent
a8d85d7c1d
commit
f2d6bc3dcf
3 changed files with 7 additions and 3 deletions
|
@ -517,7 +517,7 @@ lbry._updateClaimOwnershipCache = function(claimId) {
|
||||||
lbry.getMyClaims((claimInfos) => {
|
lbry.getMyClaims((claimInfos) => {
|
||||||
lbry._claimIdOwnershipCache[claimId] = !!claimInfos.reduce(function(match, claimInfo) {
|
lbry._claimIdOwnershipCache[claimId] = !!claimInfos.reduce(function(match, claimInfo) {
|
||||||
return match || claimInfo.claim_id == claimId;
|
return match || claimInfo.claim_id == claimId;
|
||||||
});
|
}, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -140,9 +140,12 @@ lbryuri.build = function(uriObj, includeProto=true, allowExtraProps=false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contentName) {
|
if (contentName) {
|
||||||
if (!path) {
|
if (!name) {
|
||||||
|
name = contentName;
|
||||||
|
} else if (!path) {
|
||||||
path = contentName;
|
path = contentName;
|
||||||
} else if (path !== contentName) {
|
}
|
||||||
|
if (path && path !== contentName) {
|
||||||
throw new Error('path and contentName do not match. Only one is required; most likely you wanted contentName.');
|
throw new Error('path and contentName do not match. Only one is required; most likely you wanted contentName.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ var SearchResults = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
var rows = [],
|
var rows = [],
|
||||||
seenNames = {}; //fix this when the search API returns claim IDs
|
seenNames = {}; //fix this when the search API returns claim IDs
|
||||||
|
|
||||||
for (let {name, claim, claim_id, channel_name, channel_id, txid, nout} of this.props.results) {
|
for (let {name, claim, claim_id, channel_name, channel_id, txid, nout} of this.props.results) {
|
||||||
const uri = lbryuri.build({
|
const uri = lbryuri.build({
|
||||||
channelName: channel_name,
|
channelName: channel_name,
|
||||||
|
|
Loading…
Reference in a new issue