aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-02-02 04:03:42 +0800
committerFrankie <frankie.diamond@gmail.com>2017-02-02 04:03:42 +0800
commitce0c3ed03c20eb0b7438cb9add7cbce490d7de64 (patch)
tree7ac9686e82b938097c698b3b68ddc1e1b55598c8 /ui
parente2e8a7cca06f7e6f41f417d86710227b0b5428d6 (diff)
parent82578538198de74955d7bc5cfd3c9a02d1b69a6d (diff)
downloadtangerine-wallet-browser-ce0c3ed03c20eb0b7438cb9add7cbce490d7de64.tar
tangerine-wallet-browser-ce0c3ed03c20eb0b7438cb9add7cbce490d7de64.tar.gz
tangerine-wallet-browser-ce0c3ed03c20eb0b7438cb9add7cbce490d7de64.tar.bz2
tangerine-wallet-browser-ce0c3ed03c20eb0b7438cb9add7cbce490d7de64.tar.lz
tangerine-wallet-browser-ce0c3ed03c20eb0b7438cb9add7cbce490d7de64.tar.xz
tangerine-wallet-browser-ce0c3ed03c20eb0b7438cb9add7cbce490d7de64.tar.zst
tangerine-wallet-browser-ce0c3ed03c20eb0b7438cb9add7cbce490d7de64.zip
Merge branch 'dev' into messageManagerCleanUp
Diffstat (limited to 'ui')
-rw-r--r--ui/app/account-detail.js2
-rw-r--r--ui/app/accounts/account-list-item.js4
-rw-r--r--ui/app/accounts/index.js11
-rw-r--r--ui/app/actions.js13
-rw-r--r--ui/app/components/buy-button-subview.js1
-rw-r--r--ui/app/components/coinbase-form.js1
-rw-r--r--ui/app/components/pending-msg-details.js2
-rw-r--r--ui/app/components/pending-tx-details.js2
-rw-r--r--ui/app/components/shapeshift-form.js1
-rw-r--r--ui/app/conf-tx.js8
-rw-r--r--ui/app/reducers/app.js8
-rw-r--r--ui/app/reducers/metamask.js6
-rw-r--r--ui/app/send.js2
13 files changed, 22 insertions, 39 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js
index 72a2b23df..1763c5374 100644
--- a/ui/app/account-detail.js
+++ b/ui/app/account-detail.js
@@ -24,7 +24,7 @@ function mapStateToProps (state) {
metamask: state.metamask,
identities: state.metamask.identities,
accounts: state.metamask.accounts,
- address: state.metamask.selectedAccount,
+ address: state.metamask.selectedAddress,
accountDetail: state.appState.accountDetail,
network: state.metamask.network,
unapprovedMsgs: valuesFor(state.metamask.unapprovedMsgs),
diff --git a/ui/app/accounts/account-list-item.js b/ui/app/accounts/account-list-item.js
index 74ecef07f..2a3c13d05 100644
--- a/ui/app/accounts/account-list-item.js
+++ b/ui/app/accounts/account-list-item.js
@@ -15,10 +15,10 @@ function AccountListItem () {
}
AccountListItem.prototype.render = function () {
- const { identity, selectedAccount, accounts, onShowDetail } = this.props
+ const { identity, selectedAddress, accounts, onShowDetail } = this.props
const checksumAddress = identity && identity.address && ethUtil.toChecksumAddress(identity.address)
- const isSelected = selectedAccount === identity.address
+ const isSelected = selectedAddress === identity.address
const account = accounts[identity.address]
const selectedClass = isSelected ? '.selected' : ''
diff --git a/ui/app/accounts/index.js b/ui/app/accounts/index.js
index db380cd39..e236a4e85 100644
--- a/ui/app/accounts/index.js
+++ b/ui/app/accounts/index.js
@@ -19,7 +19,7 @@ function mapStateToProps (state) {
accounts: state.metamask.accounts,
identities: state.metamask.identities,
unapprovedTxs: state.metamask.unapprovedTxs,
- selectedAccount: state.metamask.selectedAccount,
+ selectedAddress: state.metamask.selectedAddress,
scrollToBottom: state.appState.scrollToBottom,
pending,
keyrings: state.metamask.keyrings,
@@ -80,7 +80,7 @@ AccountsScreen.prototype.render = function () {
return h(AccountListItem, {
key: `acct-panel-${identity.address}`,
identity,
- selectedAccount: this.props.selectedAccount,
+ selectedAddress: this.props.selectedAddress,
accounts: this.props.accounts,
onShowDetail: this.onShowDetail.bind(this),
pending,
@@ -139,13 +139,6 @@ AccountsScreen.prototype.navigateToConfTx = function () {
this.props.dispatch(actions.showConfTxPage())
}
-AccountsScreen.prototype.onSelect = function (address, event) {
- event.stopPropagation()
- // if already selected, deselect
- if (this.props.selectedAccount === address) address = null
- this.props.dispatch(actions.setSelectedAccount(address))
-}
-
AccountsScreen.prototype.onShowDetail = function (address, event) {
event.stopPropagation()
this.props.dispatch(actions.showAccountDetail(address))
diff --git a/ui/app/actions.js b/ui/app/actions.js
index a0fed265f..fa1e0deb5 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -90,7 +90,6 @@ var actions = {
TRANSACTION_ERROR: 'TRANSACTION_ERROR',
NEXT_TX: 'NEXT_TX',
PREVIOUS_TX: 'PREV_TX',
- setSelectedAccount: setSelectedAccount,
signMsg: signMsg,
cancelMsg: cancelMsg,
sendTx: sendTx,
@@ -287,7 +286,7 @@ function importNewAccount (strategy, args) {
dispatch(actions.updateMetamaskState(newState))
dispatch({
type: actions.SHOW_ACCOUNT_DETAIL,
- value: newState.selectedAccount,
+ value: newState.selectedAddress,
})
})
}
@@ -309,10 +308,6 @@ function showInfoPage () {
}
}
-function setSelectedAccount (address) {
- return callBackgroundThenUpdate(background.setSelectedAccount, address)
-}
-
function setCurrentFiat (fiat) {
return (dispatch) => {
dispatch(this.showLoadingIndication())
@@ -508,16 +503,14 @@ function lockMetamask () {
function showAccountDetail (address) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
- background.setSelectedAccount(address, (err, newState) => {
+ background.setSelectedAddress(address, (err) => {
dispatch(actions.hideLoadingIndication())
if (err) {
return dispatch(actions.displayWarning(err.message))
}
-
- dispatch(actions.updateMetamaskState(newState))
dispatch({
type: actions.SHOW_ACCOUNT_DETAIL,
- value: newState.selectedAccount,
+ value: address,
})
})
}
diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js
index afda5bf59..3074bd7cd 100644
--- a/ui/app/components/buy-button-subview.js
+++ b/ui/app/components/buy-button-subview.js
@@ -13,7 +13,6 @@ module.exports = connect(mapStateToProps)(BuyButtonSubview)
function mapStateToProps (state) {
return {
- selectedAccount: state.selectedAccount,
warning: state.appState.warning,
buyView: state.appState.buyView,
network: state.metamask.network,
diff --git a/ui/app/components/coinbase-form.js b/ui/app/components/coinbase-form.js
index 430a3eead..40f5719bb 100644
--- a/ui/app/components/coinbase-form.js
+++ b/ui/app/components/coinbase-form.js
@@ -9,7 +9,6 @@ module.exports = connect(mapStateToProps)(CoinbaseForm)
function mapStateToProps (state) {
return {
- selectedAccount: state.selectedAccount,
warning: state.appState.warning,
}
}
diff --git a/ui/app/components/pending-msg-details.js b/ui/app/components/pending-msg-details.js
index 404cb8ae2..16308d121 100644
--- a/ui/app/components/pending-msg-details.js
+++ b/ui/app/components/pending-msg-details.js
@@ -16,7 +16,7 @@ PendingMsgDetails.prototype.render = function () {
var msgData = state.txData
var msgParams = msgData.msgParams || {}
- var address = msgParams.from || state.selectedAccount
+ var address = msgParams.from || state.selectedAddress
var identity = state.identities[address] || { address: address }
var account = state.accounts[address] || { address: address }
diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js
index 286931f6f..e8615404e 100644
--- a/ui/app/components/pending-tx-details.js
+++ b/ui/app/components/pending-tx-details.js
@@ -22,7 +22,7 @@ PTXP.render = function () {
var txData = props.txData
var txParams = txData.txParams || {}
- var address = txParams.from || props.selectedAccount
+ var address = txParams.from || props.selectedAddress
var identity = props.identities[address] || { address: address }
var account = props.accounts[address]
var balance = account ? account.balance : '0x0'
diff --git a/ui/app/components/shapeshift-form.js b/ui/app/components/shapeshift-form.js
index 383d5b623..8c9686035 100644
--- a/ui/app/components/shapeshift-form.js
+++ b/ui/app/components/shapeshift-form.js
@@ -10,7 +10,6 @@ module.exports = connect(mapStateToProps)(ShapeshiftForm)
function mapStateToProps (state) {
return {
- selectedAccount: state.selectedAccount,
warning: state.appState.warning,
isSubLoading: state.appState.isSubLoading,
qrRequested: state.appState.qrRequested,
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js
index f4fea03e9..a27219576 100644
--- a/ui/app/conf-tx.js
+++ b/ui/app/conf-tx.js
@@ -19,7 +19,7 @@ function mapStateToProps (state) {
return {
identities: state.metamask.identities,
accounts: state.metamask.accounts,
- selectedAccount: state.metamask.selectedAccount,
+ selectedAddress: state.metamask.selectedAddress,
unapprovedTxs: state.metamask.unapprovedTxs,
unapprovedMsgs: state.metamask.unapprovedMsgs,
index: state.appState.currentView.context,
@@ -99,12 +99,12 @@ ConfirmTxScreen.prototype.render = function () {
// Properties
txData: txData,
key: txData.id,
- selectedAccount: state.selectedAccount,
+ selectedAddress: state.selectedAddress,
accounts: state.accounts,
identities: state.identities,
insufficientBalance: this.checkBalanceAgainstTx(txData),
// Actions
- buyEth: this.buyEth.bind(this, txParams.from || state.selectedAccount),
+ buyEth: this.buyEth.bind(this, txParams.from || state.selectedAddress),
sendTransaction: this.sendTransaction.bind(this, txData),
cancelTransaction: this.cancelTransaction.bind(this, txData),
signMessage: this.signMessage.bind(this, txData),
@@ -131,7 +131,7 @@ function currentTxView (opts) {
ConfirmTxScreen.prototype.checkBalanceAgainstTx = function (txData) {
if (!txData.txParams) return false
var state = this.props
- var address = txData.txParams.from || state.selectedAccount
+ var address = txData.txParams.from || state.selectedAddress
var account = state.accounts[address]
var balance = account ? account.balance : '0x0'
var maxCost = new BN(txData.maxCost, 16)
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 3b960e4c1..de6536c2e 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -7,10 +7,10 @@ module.exports = reduceApp
function reduceApp (state, action) {
// clone and defaults
- const selectedAccount = state.metamask.selectedAccount
+ const selectedAddress = state.metamask.selectedAddress
const pendingTxs = hasPendingTxs(state)
let name = 'accounts'
- if (selectedAccount) {
+ if (selectedAddress) {
name = 'accountDetail'
}
if (pendingTxs) {
@@ -20,7 +20,7 @@ function reduceApp (state, action) {
var defaultView = {
name,
detailView: null,
- context: selectedAccount,
+ context: selectedAddress,
}
// confirm seed words
@@ -331,7 +331,7 @@ function reduceApp (state, action) {
warning: null,
currentView: {
name: 'accountDetail',
- context: state.metamask.selectedAccount,
+ context: state.metamask.selectedAddress,
},
accountDetail: {
subview: 'transactions',
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 5cf249197..4f13c1ab1 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -50,7 +50,7 @@ function reduceMetamask (state, action) {
return extend(metamaskState, {
isUnlocked: true,
isInitialized: true,
- selectedAccount: action.value,
+ selectedAddress: action.value,
})
case actions.LOCK_METAMASK:
@@ -101,7 +101,7 @@ function reduceMetamask (state, action) {
newState = extend(metamaskState, {
isUnlocked: true,
isInitialized: true,
- selectedAccount: action.value,
+ selectedAddress: action.value,
})
delete newState.seedWords
return newState
@@ -110,7 +110,7 @@ function reduceMetamask (state, action) {
newState = extend(metamaskState, {
isUnlocked: true,
isInitialized: true,
- selectedAccount: action.value,
+ selectedAddress: action.value,
})
delete newState.seedWords
return newState
diff --git a/ui/app/send.js b/ui/app/send.js
index b8af19028..d16270b41 100644
--- a/ui/app/send.js
+++ b/ui/app/send.js
@@ -16,7 +16,7 @@ module.exports = connect(mapStateToProps)(SendTransactionScreen)
function mapStateToProps (state) {
var result = {
- address: state.metamask.selectedAccount,
+ address: state.metamask.selectedAddress,
accounts: state.metamask.accounts,
identities: state.metamask.identities,
warning: state.appState.warning,