Skip to content

Commit

Permalink
refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Apr 23, 2019
1 parent fe43563 commit b295b53
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,24 +452,18 @@ const isAvailableIfReserved = function(bounty) {
return true;
};

var isBountyOwner = function(result) {
var bountyAddress = result['bounty_owner_address'];

if (typeof web3 == 'undefined') {
return false;
}

if (!web3.eth || typeof web3.eth.coinbase == 'undefined' || !web3.eth.coinbase) {
const isBountyOwner = result => {
if (typeof web3 == 'undefined' || !web3.eth ||
typeof web3.eth.coinbase == 'undefined' || !web3.eth.coinbase) {
return false;
}

return caseInsensitiveCompare(web3.eth.coinbase, bountyAddress);
return caseInsensitiveCompare(web3.eth.coinbase, result['bounty_owner_address']);
};

var isBountyOwnerPerLogin = function(result) {
var bounty_owner_github_username = result['bounty_owner_github_username'];

return caseInsensitiveCompare(bounty_owner_github_username, document.contxt['github_handle']);
const isBountyOwnerPerLogin = result => {
return caseInsensitiveCompare(
result['bounty_owner_github_username'], document.contxt['github_handle']
);
};

var update_title = function() {
Expand Down

0 comments on commit b295b53

Please sign in to comment.