Skip to content

Commit

Permalink
Allow to re-submit cancelled swap if cancelled via a HW wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
dan437 committed Sep 16, 2024
1 parent 6d3a56a commit ffdcef9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions ui/ducks/swaps/swaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@ export const signAndSendSwapsSmartTransaction = ({
dispatch(setSwapsSTXSubmitLoading(false));
} catch (e) {
console.log('signAndSendSwapsSmartTransaction error', e);
dispatch(setSwapsSTXSubmitLoading(false));
const {
swaps: { isFeatureFlagLoaded },
} = getState();
Expand Down
10 changes: 6 additions & 4 deletions ui/pages/swaps/prepare-swap-page/review-quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,17 +963,19 @@ export default function ReviewQuote({ setReceiveToAmount }) {
}, [dispatch, trackViewQuotePageLoadedEvent, reviewSwapClickedTimestamp]);

useEffect(() => {
// if smart transaction error is turned off, reset submit clicked boolean
if (
!currentSmartTransactionsEnabled &&
currentSmartTransactionsError &&
submitClicked
(!currentSmartTransactionsEnabled &&
currentSmartTransactionsError &&
submitClicked) ||
(isSmartTransaction && !swapsSTXLoading && submitClicked)
) {
setSubmitClicked(false);
}
}, [
currentSmartTransactionsEnabled,
currentSmartTransactionsError,
isSmartTransaction,
swapsSTXLoading,
submitClicked,
]);

Expand Down

0 comments on commit ffdcef9

Please sign in to comment.