diff --git a/src/routes/safe/store/actions/createTransaction.js b/src/routes/safe/store/actions/createTransaction.js index 2b85ee40..a212ec36 100644 --- a/src/routes/safe/store/actions/createTransaction.js +++ b/src/routes/safe/store/actions/createTransaction.js @@ -72,6 +72,12 @@ const createTransaction = ( closeSnackbar(beforeExecutionKey) pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar) + }) + .on('error', (error) => { + console.error('Tx error: ', error) + }) + .then(async (receipt) => { + closeSnackbar(pendingExecutionKey) try { await saveTxToHistory( @@ -88,12 +94,6 @@ const createTransaction = ( } catch (err) { console.error(err) } - }) - .on('error', (error) => { - console.error('Tx error: ', error) - }) - .then((receipt) => { - closeSnackbar(pendingExecutionKey) showSnackbar( isExecution diff --git a/src/routes/safe/store/actions/processTransaction.js b/src/routes/safe/store/actions/processTransaction.js index 1df89980..98daa286 100644 --- a/src/routes/safe/store/actions/processTransaction.js +++ b/src/routes/safe/store/actions/processTransaction.js @@ -103,11 +103,17 @@ const processTransaction = ( await transaction .send(sendParams) - .once('transactionHash', async (hash) => { + .once('transactionHash', (hash) => { txHash = hash closeSnackbar(beforeExecutionKey) pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar) + }) + .on('error', (error) => { + console.error('Processing transaction error: ', error) + }) + .then(async (receipt) => { + closeSnackbar(pendingExecutionKey) try { await saveTxToHistory( @@ -124,12 +130,6 @@ const processTransaction = ( } catch (err) { console.error(err) } - }) - .on('error', (error) => { - console.error('Processing transaction error: ', error) - }) - .then((receipt) => { - closeSnackbar(pendingExecutionKey) showSnackbar( shouldExecute