diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-06-14 08:47:56 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-06-14 08:53:42 +0800 |
commit | 108c4ab2c58074aa8148828fbbef8cbf3a4e23f5 (patch) | |
tree | e09b0ee929a73cd5d545ac90f695b23568c9ef58 /ui/app/account-detail.js | |
parent | de500250c463f51f68abff44c8ed6c20912b48c0 (diff) | |
download | tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar.gz tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar.zst tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.zip |
Auto populate token list with popular token balances
Half implements #175
Things to do:
- Add ability to add tokens to the list.
- Persist the token tab selection (so it is an implicit preference)
- Check what's up with the token-tracker polling, it seems like it is not waiting the interval.
Diffstat (limited to 'ui/app/account-detail.js')
-rw-r--r-- | ui/app/account-detail.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 5b2588ec5..8234a8438 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -39,7 +39,7 @@ function mapStateToProps (state) { inherits(AccountDetailScreen, Component) function AccountDetailScreen () { - this.state = {} + this.state = { tabSelection: 'history' } Component.call(this) } @@ -251,13 +251,7 @@ AccountDetailScreen.prototype.subview = function () { } AccountDetailScreen.prototype.tabSections = function () { - var subview - try { - subview = this.props.accountDetail.subview - } catch (e) { - subview = null - } - + const tabSelection = this.state.tabSelection return h('section.tabSection', [ h(TabBar, { @@ -265,7 +259,7 @@ AccountDetailScreen.prototype.tabSections = function () { { content: 'History', key: 'history' }, { content: 'Tokens', key: 'tokens' }, ], - defaultTab: subview || 'history', + defaultTab: tabSelection || 'history', tabSelected: (key) => { this.setState({ tabSelection: key }) }, @@ -276,12 +270,13 @@ AccountDetailScreen.prototype.tabSections = function () { } AccountDetailScreen.prototype.tabSwitchView = function () { - const userAddress = this.props.address + const props = this.props + const { address, network } = props const tabSelection = this.state.tabSelection || 'history' switch (tabSelection) { case 'tokens': - return h(TokenList, { userAddress }) + return h(TokenList, { userAddress: address, network }) default: return this.transactionList() } |