Skip to content

Commit

Permalink
[FIX] Issue #172 (#3863)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Antunes authored Mar 9, 2022
1 parent 0da30b0 commit 2fc4a3d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions app/components/UI/ApproveTransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ class ApproveTransactionReview extends PureComponent {
* Whether the transaction was confirmed or not
*/
transactionConfirmed: PropTypes.bool,
/**
* Dispatch set transaction object from transaction action
*/
setTransactionObject: PropTypes.func,
};

state = {
Expand Down Expand Up @@ -434,6 +438,7 @@ class ApproveTransactionReview extends PureComponent {
} = this.state;

try {
const { setTransactionObject } = this.props;
const uint = toTokenMinimalUnit(
spendLimitUnlimitedSelected ? originalApproveAmount : spendLimitCustomValue,
token.decimals
Expand All @@ -443,7 +448,15 @@ class ApproveTransactionReview extends PureComponent {
spender: spenderAddress,
value: Number(uint).toString(16),
});
const newApprovalTransaction = { ...transaction, data: approvalData };
const newApprovalTransaction = {
...transaction,
data: approvalData,
transaction: {
...transaction.transaction,
data: approvalData,
},
};

setTransactionObject(newApprovalTransaction);
} catch (err) {
Logger.log('Failed to setTransactionObject', err);
Expand Down Expand Up @@ -662,8 +675,10 @@ class ApproveTransactionReview extends PureComponent {
originalApproveAmount,
spendLimitUnlimitedSelected,
spendLimitCustomValue,
transaction: { to, data },
} = this.state;
const {
transaction: { to, data },
} = this.props;
const allowance = (!spendLimitUnlimitedSelected && spendLimitCustomValue) || originalApproveAmount;
return (
<TransactionReviewDetailsCard
Expand Down

0 comments on commit 2fc4a3d

Please sign in to comment.