Skip to content

Commit

Permalink
chore: cherry-pick #10088 (#10113)
Browse files Browse the repository at this point in the history
This PR cherry-picks #10088

Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and tommasini authored Jun 25, 2024
1 parent 8a84f15 commit b92d42e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ function SwapsQuotesView({

try {
resetTransaction();
const { transactionMeta } = await addTransaction(
const { transactionMeta, result } = await addTransaction(
{
...selectedQuote.trade,
...getTransactionPropertiesFromGasEstimates(
Expand All @@ -929,6 +929,8 @@ function SwapsQuotesView({
},
);

await result;

updateSwapsTransactions(
transactionMeta,
approvalTransactionMetaId,
Expand Down Expand Up @@ -965,7 +967,7 @@ function SwapsQuotesView({
) => {
try {
resetTransaction();
const { transactionMeta } = await addTransaction(
const { transactionMeta, result } = await addTransaction(
{
...approvalTransaction,
...getTransactionPropertiesFromGasEstimates(
Expand All @@ -979,6 +981,7 @@ function SwapsQuotesView({
},
);

await result;
setRecipient(selectedAddress);

approvalTransactionMetaId = transactionMeta.id;
Expand Down Expand Up @@ -1041,9 +1044,8 @@ function SwapsQuotesView({
const newSwapsTransactions =
TransactionController.state.swapsTransactions || {};
let approvalTransactionMetaId;

if (approvalTransaction) {
handleApprovaltransaction(
await handleApprovaltransaction(
TransactionController,
newSwapsTransactions,
approvalTransactionMetaId,
Expand All @@ -1060,7 +1062,7 @@ function SwapsQuotesView({
!shouldUseSmartTransaction ||
(shouldUseSmartTransaction && !approvalTransaction)
) {
handleSwapTransaction(
await handleSwapTransaction(
TransactionController,
newSwapsTransactions,
approvalTransactionMetaId,
Expand Down

0 comments on commit b92d42e

Please sign in to comment.