Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor code #4262

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,26 +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 (typeof web3.eth == 'undefined') {
const isBountyOwner = result => {
if (typeof web3 == 'undefined' || !web3.eth ||
typeof web3.eth.coinbase == 'undefined' || !web3.eth.coinbase) {
return false;
}
if (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