From b295b532cde445c293b07ac904c83307e8898a81 Mon Sep 17 00:00:00 2001 From: Aditya Anand Date: Tue, 23 Apr 2019 21:04:15 +0530 Subject: [PATCH] refactored code --- app/assets/v2/js/pages/bounty_details.js | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/app/assets/v2/js/pages/bounty_details.js b/app/assets/v2/js/pages/bounty_details.js index c0517f4cd47..f18d38f08e4 100644 --- a/app/assets/v2/js/pages/bounty_details.js +++ b/app/assets/v2/js/pages/bounty_details.js @@ -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() {