Skip to content

Commit

Permalink
Decouple confirm transaction screen from the selected address
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Dec 3, 2019
1 parent e25da41 commit 77ebae0
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ const mapStateToProps = (state, ownProps) => {
identities,
addressBook,
currentCurrency,
selectedAddress,
selectedAddressTxList,
assetImages,
network,
unapprovedTxs,
Expand All @@ -72,7 +70,7 @@ const mapStateToProps = (state, ownProps) => {
nonce,
} = confirmTransaction
const { txParams = {}, lastGasPrice, id: transactionId, transactionCategory } = txData
const transaction = R.find(({ id }) => id === (transactionId || Number(paramsTransactionId)))(selectedAddressTxList) || {}
const transaction = Object.values(unapprovedTxs).find(({ id }) => id === (transactionId || Number(paramsTransactionId))) || {}
const {
from: fromAddress,
to: txParamsToAddress,
Expand All @@ -84,8 +82,8 @@ const mapStateToProps = (state, ownProps) => {
const accounts = getMetaMaskAccounts(state)
const assetImage = assetImages[txParamsToAddress]

const { balance } = accounts[selectedAddress]
const { name: fromName } = identities[selectedAddress]
const { balance } = accounts[fromAddress]
const { name: fromName } = identities[fromAddress]
const toAddress = propsToAddress || txParamsToAddress
const toName = identities[toAddress]
? identities[toAddress].name
Expand Down

0 comments on commit 77ebae0

Please sign in to comment.