diff options
author | Dan J Miller <danjm.com@gmail.com> | 2018-06-07 01:51:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 01:51:45 +0800 |
commit | 191c3df108562d3f72d6206dfdcd591ad5c80e73 (patch) | |
tree | 9e4a5bc46f56359db1d589501af2505378232177 /ui/app | |
parent | c2e3194dbf4e2a3fd2bdffb3300ec0cd822dc78e (diff) | |
parent | 6ee96854904d149c00b629f5025fda1bf5c60070 (diff) | |
download | tangerine-wallet-browser-191c3df108562d3f72d6206dfdcd591ad5c80e73.tar tangerine-wallet-browser-191c3df108562d3f72d6206dfdcd591ad5c80e73.tar.gz tangerine-wallet-browser-191c3df108562d3f72d6206dfdcd591ad5c80e73.tar.bz2 tangerine-wallet-browser-191c3df108562d3f72d6206dfdcd591ad5c80e73.tar.lz tangerine-wallet-browser-191c3df108562d3f72d6206dfdcd591ad5c80e73.tar.xz tangerine-wallet-browser-191c3df108562d3f72d6206dfdcd591ad5c80e73.tar.zst tangerine-wallet-browser-191c3df108562d3f72d6206dfdcd591ad5c80e73.zip |
Merge pull request #4507 from whymarrh/fix-account-order
Render accounts in keyring order
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/account-menu/index.js | 7 | ||||
-rw-r--r-- | ui/app/reducers.js | 7 | ||||
-rw-r--r-- | ui/app/reducers/identities.js | 15 |
3 files changed, 4 insertions, 25 deletions
diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js index 7638995ea..f34631ca8 100644 --- a/ui/app/components/account-menu/index.js +++ b/ui/app/components/account-menu/index.js @@ -135,11 +135,12 @@ AccountMenu.prototype.renderAccounts = function () { showAccountDetail, } = this.props - return Object.keys(identities).map((key, index) => { - const identity = identities[key] + const accountOrder = keyrings.reduce((list, keyring) => list.concat(keyring.accounts), []) + return accountOrder.map((address) => { + const identity = identities[address] const isSelected = identity.address === selectedAddress - const balanceValue = accounts[key] ? accounts[key].balance : '' + const balanceValue = accounts[address] ? accounts[address].balance : '' const formattedBalance = balanceValue ? formatBalance(balanceValue, 6) : '...' const simpleAddress = identity.address.substring(2).toLowerCase() diff --git a/ui/app/reducers.js b/ui/app/reducers.js index f155b2bf3..e3a3077d9 100644 --- a/ui/app/reducers.js +++ b/ui/app/reducers.js @@ -4,7 +4,6 @@ const copyToClipboard = require('copy-to-clipboard') // // Sub-Reducers take in the complete state and return their sub-state // -const reduceIdentities = require('./reducers/identities') const reduceMetamask = require('./reducers/metamask') const reduceApp = require('./reducers/app') const reduceLocale = require('./reducers/locale') @@ -22,12 +21,6 @@ function rootReducer (state, action) { } // - // Identities - // - - state.identities = reduceIdentities(state, action) - - // // MetaMask // diff --git a/ui/app/reducers/identities.js b/ui/app/reducers/identities.js deleted file mode 100644 index 341a404e7..000000000 --- a/ui/app/reducers/identities.js +++ /dev/null @@ -1,15 +0,0 @@ -const extend = require('xtend') - -module.exports = reduceIdentities - -function reduceIdentities (state, action) { - // clone + defaults - var idState = extend({ - - }, state.identities) - - switch (action.type) { - default: - return idState - } -} |