Skip to content

Commit

Permalink
Merge pull request #56 from ZooWallet/fix/DapperBug
Browse files Browse the repository at this point in the history
Show alert when Dapper is locked
  • Loading branch information
Ankarrr authored Aug 26, 2019
2 parents 7aaa3e0 + f0a9e02 commit e6ff812
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions js/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const dapper = () => swal({
icon: 'warning',
});

const dapperIsLocked = () => swal({
title: 'Dapper is locked',
text: 'Please login your Dapper wallet.',
icon: 'warning',
});

const ledger = () => swal({
title: 'Can\'t find Ledger',
text: 'Please check your Ledger wallet is connected to your computer and navigate to the Ethereum app.',
Expand Down Expand Up @@ -61,6 +67,7 @@ const help = () => swal({
module.exports = {
metamask,
dapper,
dapperIsLocked,
ledger,
trezor,
wcUnsupport,
Expand Down
8 changes: 7 additions & 1 deletion js/dappModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ const addWalletBtnListener = (walletConnector, end, onLoginSuccess) => {

console.debug('Use Dapper');

// Check if Dapper is unclocked
if (!(windowWeb3.eth.coinbase)) {
console.debug('Dapper is locked');
myAlert.dapperIsLocked();
return;
}

window.ethereum = windowProvider;
window.web3 = windowWeb3;


modalStartLoading();
window.ethereum.enable().then((res) => {
console.debug('res: ', res);
Expand Down

0 comments on commit e6ff812

Please sign in to comment.