Merge pull request #147 from lbryio/fix-my-claim-detection-publish
On Publish page, fix detection of the user's own claim on a name
This commit is contained in:
commit
b58748cfdb
2 changed files with 7 additions and 6 deletions
|
@ -176,7 +176,9 @@ lbry.getClaimInfo = function(name, callback) {
|
|||
}
|
||||
|
||||
lbry.getMyClaim = function(name, callback) {
|
||||
lbry.call('get_my_claim', { name: name }, callback);
|
||||
lbry.call('claim_list_mine', {}, (claims) => {
|
||||
callback(claims.find((claim) => claim.name == name) || null);
|
||||
});
|
||||
}
|
||||
|
||||
lbry.getKeyFee = function(name, callback, errorCallback) {
|
||||
|
|
|
@ -197,15 +197,14 @@ var PublishPage = React.createClass({
|
|||
return;
|
||||
}
|
||||
|
||||
var topClaimIsMine = (myClaimInfo && myClaimInfo.amount >= claimInfo.amount);
|
||||
|
||||
var newState = {
|
||||
const topClaimIsMine = (myClaimInfo && myClaimInfo.amount >= claimInfo.amount);
|
||||
const newState = {
|
||||
name: name,
|
||||
nameResolved: true,
|
||||
topClaimValue: parseFloat(claimInfo.amount),
|
||||
myClaimExists: !!myClaimInfo,
|
||||
myClaimValue: parseFloat(myClaimInfo.amount),
|
||||
myClaimMetadata: myClaimInfo.value,
|
||||
myClaimValue: myClaimInfo ? parseFloat(myClaimInfo.amount) : null,
|
||||
myClaimMetadata: myClaimInfo ? myClaimInfo.value : null,
|
||||
topClaimIsMine: topClaimIsMine,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue