Skip to content

Commit

Permalink
Update data on Approve screen after updating custom spend limit (Meta…
Browse files Browse the repository at this point in the history
…Mask#7918)

After updating the custom spend limit on the approve screen, the data
for the transaction was not being updated. Instead it showed the
original transaction data. The transaction data was being updated
correctly in the final transaction though.

The approve screen has been updated to ensure changes to the custom
spend limit are reflected correctly in the data shown.
  • Loading branch information
Gudahtt authored and yqrashawn committed Feb 10, 2020
1 parent f8e310f commit da8494b
Showing 1 changed file with 25 additions and 31 deletions.
56 changes: 25 additions & 31 deletions ui/app/pages/confirm-approve/confirm-approve.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,44 +85,38 @@ export default class ConfirmApprove extends Component {
: ''
}

const customData = customPermissionAmount
? getCustomTxParamsData(data, { customPermissionAmount, tokenAmount, decimals })
: null

return (
<ConfirmTransactionBase
toAddress={toAddress}
identiconAddress={tokenAddress}
showAccountInHeader
title={tokensText}
contentComponent={
(
<ConfirmApproveContent
siteImage={siteImage}
setCustomAmount={newAmount => {
this.setState({ customPermissionAmount: newAmount })
}}
customTokenAmount={String(customPermissionAmount)}
tokenAmount={String(tokenAmount)}
origin={origin}
tokenSymbol={tokenSymbol}
tokenBalance={tokenBalance}
showCustomizeGasModal={() => showCustomizeGasModal(txData)}
showEditApprovalPermissionModal={showEditApprovalPermissionModal}
data={data}
toAddress={toAddress}
currentCurrency={currentCurrency}
ethTransactionTotal={ethTransactionTotal}
fiatTransactionTotal={fiatTransactionTotal}
/>
)
}
contentComponent={(
<ConfirmApproveContent
siteImage={siteImage}
setCustomAmount={(newAmount) => {
this.setState({ customPermissionAmount: newAmount })
}}
customTokenAmount={String(customPermissionAmount)}
tokenAmount={String(tokenAmount)}
origin={origin}
tokenSymbol={tokenSymbol}
tokenBalance={tokenBalance}
showCustomizeGasModal={() => showCustomizeGasModal(txData)}
showEditApprovalPermissionModal={showEditApprovalPermissionModal}
data={customData || data}
toAddress={toAddress}
currentCurrency={currentCurrency}
ethTransactionTotal={ethTransactionTotal}
fiatTransactionTotal={fiatTransactionTotal}
/>
)}
hideSenderToRecipient
customTxParamsData={
customPermissionAmount
? getCustomTxParamsData(data, {
customPermissionAmount,
tokenAmount,
decimals,
})
: null
}
customTxParamsData={customData}
{...restProps}
/>
)
Expand Down

0 comments on commit da8494b

Please sign in to comment.