diff --git a/js/lbry.js b/js/lbry.js index f911a29ab..02bc906c5 100644 --- a/js/lbry.js +++ b/js/lbry.js @@ -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) { diff --git a/js/page/publish.js b/js/page/publish.js index 8e3ede775..d1d48bc3a 100644 --- a/js/page/publish.js +++ b/js/page/publish.js @@ -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, };