diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-12-23 06:43:00 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-12-23 06:43:00 +0800 |
commit | 98527c1c254fe2d438191c73053dcf3223062ef3 (patch) | |
tree | b4f989f438aa3b3896ccaea2e933a36b45ee7cd3 | |
parent | 73cdf0bfd49470bad1f0da4d0d894278c87af54e (diff) | |
download | tangerine-wallet-browser-98527c1c254fe2d438191c73053dcf3223062ef3.tar tangerine-wallet-browser-98527c1c254fe2d438191c73053dcf3223062ef3.tar.gz tangerine-wallet-browser-98527c1c254fe2d438191c73053dcf3223062ef3.tar.bz2 tangerine-wallet-browser-98527c1c254fe2d438191c73053dcf3223062ef3.tar.lz tangerine-wallet-browser-98527c1c254fe2d438191c73053dcf3223062ef3.tar.xz tangerine-wallet-browser-98527c1c254fe2d438191c73053dcf3223062ef3.tar.zst tangerine-wallet-browser-98527c1c254fe2d438191c73053dcf3223062ef3.zip |
Fix account injection bug
It seems `selectedAddress` was removed from the keyring-controller’s state, and is used to populate the injected current account.
I couldn't help myself, I dug around, I found a PR named [changed all instances of selectedAddress to selectedAccount](https://github.com/MetaMask/metamask-plugin/commit/f5b0795ac5582dd53de728479cf47c43eabfe67c) by @Zanibas. Sorry, Kevin! Had you actually changed all instances, this bug would not have happened.
Fixes #908
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 30fcbcb66..ccb592693 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -72,13 +72,13 @@ MetamaskInpageProvider.prototype.send = function (payload) { case 'eth_accounts': // read from localStorage - selectedAccount = self.publicConfigStore.get('selectedAddress') + selectedAccount = self.publicConfigStore.get('selectedAccount') result = selectedAccount ? [selectedAccount] : [] break case 'eth_coinbase': // read from localStorage - selectedAccount = self.publicConfigStore.get('selectedAddress') + selectedAccount = self.publicConfigStore.get('selectedAccount') result = selectedAccount || '0x0000000000000000000000000000000000000000' break @@ -119,6 +119,7 @@ function remoteStoreWithLocalStorageCache (storageKey) { var store = new RemoteStore(initState) // cache the latest state locally store.subscribe(function (state) { + console.log('received state update %s of %s', storageKey, state) localStorage[storageKey] = JSON.stringify(state) }) |