Skip to content

Commit

Permalink
chore: use finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
BZahory committed Jul 31, 2024
1 parent 2373cd7 commit 8d99049
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ui/components/multichain/pages/send/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,6 @@ export const SendPage = () => {
try {
await dispatch(signTransaction(history));

// prevents state update on unmounted component error
if (isSubmitting) {
setIsSubmitting(false);
}

trackEvent({
category: MetaMetricsEventCategory.Transactions,
event: 'Complete',
Expand All @@ -253,9 +248,12 @@ export const SendPage = () => {
},
});
} catch {
setIsSubmitting(false);
setError(TRANSACTION_ERRORED_EVENT);
// throw error;
} finally {
// prevents state update on unmounted component error
if (isSubmitting) {
setIsSubmitting(false);
}
}
};

Expand Down

0 comments on commit 8d99049

Please sign in to comment.