Last active
January 14, 2019 12:15
-
-
Save ylv-io/fae2fedad126eb8dfd2bc2989684197d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let account = getAccount(); | |
| let accountInterval = setInterval(() => { | |
| if (getAccount() !== account) { | |
| account = getAccount(); | |
| if (account === undefined) { | |
| // if account changed to undefined, that means metamask is now locked | |
| updateEverything(); | |
| } else { | |
| // if account is not undefined, that means metamask is now unlocked | |
| updateEverything(); | |
| } | |
| } | |
| }, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment