Skip to content

Commit

Permalink
Added banner for faucet
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Usman committed Nov 7, 2018
1 parent 77ca184 commit 0d660d3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,21 +783,29 @@ var trigger_faucet_form_web3_hooks = function() {
$('#faucet_form').addClass('hidden');
mixpanel_track_once('No Metamask Error', params);
return;
} else if (is_metamask_unlocked && !is_metamask_approved) {
$('#no_metamask_error').css('display', 'none');
$('#unlock_metamask_error').css('display', 'none');
$('#connect_metamask_error').css('display', 'block');
$('#faucet_form').addClass('hidden');
} else if (!web3.eth.coinbase) {
$('#no_metamask_error').css('display', 'none');
$('#unlock_metamask_error').css('display', 'block');
$('#connect_metamask_error').css('display', 'none');
$('#faucet_form').addClass('hidden');
return;
} else if (balance >= faucet_amount) {
$('#no_metamask_error').css('display', 'none');
$('#unlock_metamask_error').css('display', 'none');
$('#connect_metamask_error').css('display', 'none');
$('#over_balance_error').css('display', 'block');
$('#faucet_form').addClass('hidden');
mixpanel_track_once('Faucet Available Funds Metamask Error', params);
} else {
$('#over_balance_error').css('display', 'none');
$('#no_metamask_error').css('display', 'none');
$('#unlock_metamask_error').css('display', 'none');
$('#connect_metamask_error').css('display', 'none');
$('#faucet_form').removeClass('hidden');
}
}
Expand All @@ -808,6 +816,11 @@ var trigger_faucet_form_web3_hooks = function() {
mixpanel_track_once('No Metamask Error', params);
return;
}
if (is_metamask_unlocked && !is_metamask_approved) {
$('#unlock_metamask_error').css('display', 'block');
$('#connect_metamask_error').css('display', 'block');
$('#faucet_form').addClass('hidden');
}
if (!web3.eth.coinbase) {
$('#unlock_metamask_error').css('display', 'block');
$('#faucet_form').addClass('hidden');
Expand Down

0 comments on commit 0d660d3

Please sign in to comment.