Ask user to unlock their account #23

Merged
galfert merged 2 commits from feature/22-handle_locked_metamask into master 2017-06-14 20:15:18 +00:00
Showing only changes of commit 22affa7663 - Show all commits
+1 -1
View File
@@ -11,7 +11,7 @@ export default Ember.Route.extend({
if (kredits.get('web3') && kredits.get('web3Provided')) {
raucao commented 2017-06-14 05:21:06 +00:00 (Migrated from github.com)
Review

Wouldn't the second condition be enough here?

Wouldn't the second condition be enough here?
galfert commented 2017-06-14 10:02:42 +00:00 (Migrated from github.com)
Review

No, because the web3 property actually checks if there is a user provided web3 when called for the first time. And it's not being called before this, so we have to access it first.

No, because the `web3` property actually checks if there is a user provided web3 when called for the first time. And it's not being called before this, so we have to access it first.
kredits.get('web3').eth.getAccounts((error, accounts) => {
if (error || accounts.length === 0) {
if (confirm('Please unlock your accounts')) {
if (confirm('It looks like you have an Ethereum wallet available. Please unlock your account.')) {
transition.retry();
}
}