Merge branch '124-web3connect-new' of github.com:gnosis/safe-react into 158-notifications-improvements

This commit is contained in:
mmv 2019-11-11 15:18:31 +04:00
commit 9d0549fc59
2 changed files with 18 additions and 18 deletions

View File

@ -72,7 +72,7 @@ const createTransaction = (
await tx
.send(sendParams)
.once('transactionHash', (hash) => {
.once('transactionHash', async (hash) => {
txHash = hash
closeSnackbar(beforeExecutionKey)
const pendingExecutionNotification: Notification = isExecution
@ -85,12 +85,6 @@ const createTransaction = (
options: notificationsQueue.pendingExecution.moreConfirmationsNeeded.options,
}
pendingExecutionKey = showSnackbar(pendingExecutionNotification, enqueueSnackbar, closeSnackbar)
})
.on('error', (error) => {
console.error('Tx error: ', error)
})
.then(async (receipt) => {
closeSnackbar(pendingExecutionKey)
try {
await saveTxToHistory(
@ -100,13 +94,19 @@ const createTransaction = (
txData,
CALL,
nonce,
receipt.transactionHash,
txHash,
from,
isExecution ? TX_TYPE_EXECUTION : TX_TYPE_CONFIRMATION,
)
} catch (err) {
console.log(err)
console.error(err)
}
})
.on('error', (error) => {
console.error('Tx error: ', error)
})
.then((receipt) => {
closeSnackbar(pendingExecutionKey)
if (isExecution) {
showSnackbar(notificationsQueue.afterExecution, enqueueSnackbar, closeSnackbar)

View File

@ -104,7 +104,7 @@ const processTransaction = (
await transaction
.send(sendParams)
.once('transactionHash', (hash) => {
.once('transactionHash', async (hash) => {
txHash = hash
closeSnackbar(beforeExecutionKey)
const notification: Notification = {
@ -112,12 +112,6 @@ const processTransaction = (
options: notificationsQueue.pendingExecution.noMoreConfirmationsNeeded.options,
}
pendingExecutionKey = showSnackbar(notification, enqueueSnackbar, closeSnackbar)
})
.on('error', (error) => {
console.error('Processing transaction error: ', error)
})
.then(async (receipt) => {
closeSnackbar(pendingExecutionKey)
try {
await saveTxToHistory(
@ -127,13 +121,19 @@ const processTransaction = (
tx.data,
CALL,
nonce,
receipt.transactionHash,
txHash,
from,
shouldExecute ? TX_TYPE_EXECUTION : TX_TYPE_CONFIRMATION,
)
} catch (err) {
console.log(err)
console.error(err)
}
})
.on('error', (error) => {
console.error('Processing transaction error: ', error)
})
.then((receipt) => {
closeSnackbar(pendingExecutionKey)
showSnackbar(notificationsQueue.afterExecution, enqueueSnackbar, closeSnackbar)
dispatch(fetchTransactions(safeAddress))