Rename variables in pending confirmations notification
This commit is contained in:
parent
b771ba78f8
commit
6e52f0fddd
|
@ -8,8 +8,8 @@ import { type Notification, NOTIFICATIONS } from './notificationTypes'
|
||||||
type NotificationsQueue = {
|
type NotificationsQueue = {
|
||||||
beforeExecution: Notification,
|
beforeExecution: Notification,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: Notification,
|
noMoreConfirmationsNeeded: Notification,
|
||||||
multiple: Notification,
|
moreConfirmationsNeeded: Notification,
|
||||||
},
|
},
|
||||||
afterExecution: Notification,
|
afterExecution: Notification,
|
||||||
afterExecutionError: Notification,
|
afterExecutionError: Notification,
|
||||||
|
@ -19,8 +19,8 @@ type NotificationsQueue = {
|
||||||
const standardTxNotificationsQueue: NotificationsQueue = {
|
const standardTxNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: NOTIFICATIONS.TX_PENDING_MSG,
|
noMoreConfirmationsNeeded: NOTIFICATIONS.TX_PENDING_MSG,
|
||||||
multiple: NOTIFICATIONS.TX_PENDING_MORE_CONFIRMATIONS_MSG,
|
moreConfirmationsNeeded: NOTIFICATIONS.TX_PENDING_MORE_CONFIRMATIONS_MSG,
|
||||||
},
|
},
|
||||||
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
||||||
afterExecution: NOTIFICATIONS.TX_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.TX_EXECUTED_MSG,
|
||||||
|
@ -30,8 +30,8 @@ const standardTxNotificationsQueue: NotificationsQueue = {
|
||||||
const confirmationTxNotificationsQueue: NotificationsQueue = {
|
const confirmationTxNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: NOTIFICATIONS.TX_CONFIRMATION_PENDING_MSG,
|
noMoreConfirmationsNeeded: NOTIFICATIONS.TX_CONFIRMATION_PENDING_MSG,
|
||||||
multiple: null,
|
moreConfirmationsNeeded: null,
|
||||||
},
|
},
|
||||||
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
||||||
afterExecution: NOTIFICATIONS.TX_CONFIRMATION_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.TX_CONFIRMATION_EXECUTED_MSG,
|
||||||
|
@ -41,8 +41,8 @@ const confirmationTxNotificationsQueue: NotificationsQueue = {
|
||||||
const cancellationTxNotificationsQueue: NotificationsQueue = {
|
const cancellationTxNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: NOTIFICATIONS.TX_PENDING_MSG,
|
noMoreConfirmationsNeeded: NOTIFICATIONS.TX_PENDING_MSG,
|
||||||
multiple: NOTIFICATIONS.TX_PENDING_MORE_CONFIRMATIONS_MSG,
|
moreConfirmationsNeeded: NOTIFICATIONS.TX_PENDING_MORE_CONFIRMATIONS_MSG,
|
||||||
},
|
},
|
||||||
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
||||||
afterExecution: NOTIFICATIONS.TX_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.TX_EXECUTED_MSG,
|
||||||
|
@ -52,8 +52,8 @@ const cancellationTxNotificationsQueue: NotificationsQueue = {
|
||||||
const ownerChangeTxNotificationsQueue: NotificationsQueue = {
|
const ownerChangeTxNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: NOTIFICATIONS.SIGN_OWNER_CHANGE_MSG,
|
beforeExecution: NOTIFICATIONS.SIGN_OWNER_CHANGE_MSG,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: NOTIFICATIONS.ONWER_CHANGE_PENDING_MSG,
|
noMoreConfirmationsNeeded: NOTIFICATIONS.ONWER_CHANGE_PENDING_MSG,
|
||||||
multiple: NOTIFICATIONS.ONWER_CHANGE_PENDING_MORE_CONFIRMATIONS_MSG,
|
moreConfirmationsNeeded: NOTIFICATIONS.ONWER_CHANGE_PENDING_MORE_CONFIRMATIONS_MSG,
|
||||||
},
|
},
|
||||||
afterRejection: NOTIFICATIONS.ONWER_CHANGE_REJECTED_MSG,
|
afterRejection: NOTIFICATIONS.ONWER_CHANGE_REJECTED_MSG,
|
||||||
afterExecution: NOTIFICATIONS.OWNER_CHANGE_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.OWNER_CHANGE_EXECUTED_MSG,
|
||||||
|
@ -63,8 +63,8 @@ const ownerChangeTxNotificationsQueue: NotificationsQueue = {
|
||||||
const safeNameChangeNotificationsQueue: NotificationsQueue = {
|
const safeNameChangeNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: null,
|
beforeExecution: null,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: null,
|
noMoreConfirmationsNeeded: null,
|
||||||
multiple: null,
|
moreConfirmationsNeeded: null,
|
||||||
},
|
},
|
||||||
afterRejection: null,
|
afterRejection: null,
|
||||||
afterExecution: NOTIFICATIONS.SAFE_NAME_CHANGE_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.SAFE_NAME_CHANGE_EXECUTED_MSG,
|
||||||
|
@ -74,8 +74,8 @@ const safeNameChangeNotificationsQueue: NotificationsQueue = {
|
||||||
const ownerNameChangeNotificationsQueue: NotificationsQueue = {
|
const ownerNameChangeNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: null,
|
beforeExecution: null,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: null,
|
noMoreConfirmationsNeeded: null,
|
||||||
multiple: null,
|
moreConfirmationsNeeded: null,
|
||||||
},
|
},
|
||||||
afterRejection: null,
|
afterRejection: null,
|
||||||
afterExecution: NOTIFICATIONS.OWNER_NAME_CHANGE_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.OWNER_NAME_CHANGE_EXECUTED_MSG,
|
||||||
|
@ -85,8 +85,8 @@ const ownerNameChangeNotificationsQueue: NotificationsQueue = {
|
||||||
const thresholdChangeTxNotificationsQueue: NotificationsQueue = {
|
const thresholdChangeTxNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: NOTIFICATIONS.SIGN_THRESHOLD_CHANGE_MSG,
|
beforeExecution: NOTIFICATIONS.SIGN_THRESHOLD_CHANGE_MSG,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: NOTIFICATIONS.THRESHOLD_CHANGE_PENDING_MSG,
|
noMoreConfirmationsNeeded: NOTIFICATIONS.THRESHOLD_CHANGE_PENDING_MSG,
|
||||||
multiple: NOTIFICATIONS.THRESHOLD_CHANGE_PENDING_MORE_CONFIRMATIONS_MSG,
|
moreConfirmationsNeeded: NOTIFICATIONS.THRESHOLD_CHANGE_PENDING_MORE_CONFIRMATIONS_MSG,
|
||||||
},
|
},
|
||||||
afterRejection: NOTIFICATIONS.THRESHOLD_CHANGE_REJECTED_MSG,
|
afterRejection: NOTIFICATIONS.THRESHOLD_CHANGE_REJECTED_MSG,
|
||||||
afterExecution: NOTIFICATIONS.THRESHOLD_CHANGE_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.THRESHOLD_CHANGE_EXECUTED_MSG,
|
||||||
|
@ -96,8 +96,8 @@ const thresholdChangeTxNotificationsQueue: NotificationsQueue = {
|
||||||
const defaultNotificationsQueue: NotificationsQueue = {
|
const defaultNotificationsQueue: NotificationsQueue = {
|
||||||
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
beforeExecution: NOTIFICATIONS.SIGN_TX_MSG,
|
||||||
pendingExecution: {
|
pendingExecution: {
|
||||||
single: NOTIFICATIONS.TX_PENDING_MSG,
|
noMoreConfirmationsNeeded: NOTIFICATIONS.TX_PENDING_MSG,
|
||||||
multiple: NOTIFICATIONS.TX_PENDING_MORE_CONFIRMATIONS_MSG,
|
moreConfirmationsNeeded: NOTIFICATIONS.TX_PENDING_MORE_CONFIRMATIONS_MSG,
|
||||||
},
|
},
|
||||||
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
|
||||||
afterExecution: NOTIFICATIONS.TX_EXECUTED_MSG,
|
afterExecution: NOTIFICATIONS.TX_EXECUTED_MSG,
|
||||||
|
|
|
@ -71,11 +71,12 @@ const createTransaction = (
|
||||||
.once('transactionHash', (hash) => {
|
.once('transactionHash', (hash) => {
|
||||||
txHash = hash
|
txHash = hash
|
||||||
closeSnackbar(beforeExecutionKey)
|
closeSnackbar(beforeExecutionKey)
|
||||||
const pendingExecutionNotification: Notification = {
|
const pendingExecutionNotification: Notification = isExecution ? {
|
||||||
message: isExecution
|
message: notificationsQueue.pendingExecution.noMoreConfirmationsNeeded.message,
|
||||||
? notificationsQueue.pendingExecution.single.message
|
options: notificationsQueue.pendingExecution.noMoreConfirmationsNeeded.options,
|
||||||
: notificationsQueue.pendingExecution.multiple.message,
|
} : {
|
||||||
options: notificationsQueue.pendingExecution.single.options,
|
message: notificationsQueue.pendingExecution.moreConfirmationsNeeded.message,
|
||||||
|
options: notificationsQueue.pendingExecution.moreConfirmationsNeeded.options,
|
||||||
}
|
}
|
||||||
pendingExecutionKey = showSnackbar(pendingExecutionNotification, enqueueSnackbar, closeSnackbar)
|
pendingExecutionKey = showSnackbar(pendingExecutionNotification, enqueueSnackbar, closeSnackbar)
|
||||||
})
|
})
|
||||||
|
|
|
@ -102,8 +102,8 @@ const processTransaction = (
|
||||||
txHash = hash
|
txHash = hash
|
||||||
closeSnackbar(beforeExecutionKey)
|
closeSnackbar(beforeExecutionKey)
|
||||||
const notification: Notification = {
|
const notification: Notification = {
|
||||||
message: notificationsQueue.pendingExecution.single.message,
|
message: notificationsQueue.pendingExecution.noMoreConfirmationsNeeded.message,
|
||||||
options: notificationsQueue.pendingExecution.single.options,
|
options: notificationsQueue.pendingExecution.noMoreConfirmationsNeeded.options,
|
||||||
}
|
}
|
||||||
pendingExecutionKey = showSnackbar(notification, enqueueSnackbar, closeSnackbar)
|
pendingExecutionKey = showSnackbar(notification, enqueueSnackbar, closeSnackbar)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue