diff --git a/src/logic/notifications/notificationBuilder.js b/src/logic/notifications/notificationBuilder.js index 84b5b908..893d17b6 100644 --- a/src/logic/notifications/notificationBuilder.js +++ b/src/logic/notifications/notificationBuilder.js @@ -5,7 +5,7 @@ import { Close as IconClose } from '@material-ui/icons' import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions' import { type Notification, NOTIFICATIONS } from './notificationTypes' -type NotificationsQueue = { +export type NotificationsQueue = { beforeExecution: Notification, pendingExecution: { noMoreConfirmationsNeeded: Notification, @@ -104,7 +104,7 @@ const defaultNotificationsQueue: NotificationsQueue = { afterExecutionError: NOTIFICATIONS.TX_FAILED_MSG, } -export const getNofiticationsFromTxType = (txType: string) => { +export const getNotificationsFromTxType = (txType: string) => { let notificationsQueue: NotificationsQueue switch (txType) { diff --git a/src/routes/safe/components/Settings/ChangeSafeName/index.jsx b/src/routes/safe/components/Settings/ChangeSafeName/index.jsx index 764d7994..ec5a969e 100644 --- a/src/routes/safe/components/Settings/ChangeSafeName/index.jsx +++ b/src/routes/safe/components/Settings/ChangeSafeName/index.jsx @@ -12,7 +12,7 @@ import GnoForm from '~/components/forms/GnoForm' import Row from '~/components/layout/Row' import Paragraph from '~/components/layout/Paragraph' import Button from '~/components/layout/Button' -import { getNofiticationsFromTxType, showSnackbar } from '~/logic/notifications' +import { getNotificationsFromTxType, showSnackbar } from '~/logic/notifications' import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions' import { styles } from './style' @@ -36,7 +36,7 @@ const ChangeSafeName = (props: Props) => { const handleSubmit = (values) => { updateSafe({ address: safeAddress, name: values.safeName }) - const notification = getNofiticationsFromTxType(TX_NOTIFICATION_TYPES.SAFE_NAME_CHANGE_TX) + const notification = getNotificationsFromTxType(TX_NOTIFICATION_TYPES.SAFE_NAME_CHANGE_TX) showSnackbar(notification.afterExecution, enqueueSnackbar, closeSnackbar) } diff --git a/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx b/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx index 867d9db3..0f9bddb0 100644 --- a/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.jsx @@ -16,7 +16,7 @@ import TextField from '~/components/forms/TextField' import Paragraph from '~/components/layout/Paragraph' import Identicon from '~/components/Identicon' import { composeValidators, required, minMaxLength } from '~/components/forms/validator' -import { getNofiticationsFromTxType, showSnackbar } from '~/logic/notifications' +import { getNotificationsFromTxType, showSnackbar } from '~/logic/notifications' import { TX_NOTIFICATION_TYPES } from '~/logic/safe/transactions' import { getEtherScanLink } from '~/logic/wallets/getWeb3' import Modal from '~/components/Modal' @@ -57,7 +57,7 @@ const EditOwnerComponent = ({ const handleSubmit = (values) => { editSafeOwner({ safeAddress, ownerAddress, ownerName: values.ownerName }) - const notification = getNofiticationsFromTxType(TX_NOTIFICATION_TYPES.OWNER_NAME_CHANGE_TX) + const notification = getNotificationsFromTxType(TX_NOTIFICATION_TYPES.OWNER_NAME_CHANGE_TX) showSnackbar(notification.afterExecution, enqueueSnackbar, closeSnackbar) onClose() diff --git a/src/routes/safe/store/actions/createTransaction.js b/src/routes/safe/store/actions/createTransaction.js index 4478bd8a..8de8f141 100644 --- a/src/routes/safe/store/actions/createTransaction.js +++ b/src/routes/safe/store/actions/createTransaction.js @@ -1,5 +1,6 @@ // @flow import type { Dispatch as ReduxDispatch, GetState } from 'redux' +import { push } from 'connected-react-router' import { EMPTY_DATA } from '~/logic/wallets/ethTransactions' import { userAccountSelector } from '~/logic/wallets/store/selectors' import fetchTransactions from '~/routes/safe/store/actions/fetchTransactions' @@ -17,11 +18,12 @@ import { import { type Notification, type NotificationsQueue, - getNofiticationsFromTxType, + getNotificationsFromTxType, showSnackbar, } from '~/logic/notifications' import { getErrorMessage } from '~/test/utils/ethereumErrors' import { ZERO_ADDRESS } from '~/logic/wallets/ethAddresses' +import { SAFELIST_ADDRESS } from '~/routes/routes' const createTransaction = ( safeAddress: string, @@ -35,6 +37,8 @@ const createTransaction = ( ) => async (dispatch: ReduxDispatch, getState: GetState) => { const state: GlobalState = getState() + dispatch(push(`${SAFELIST_ADDRESS}/${safeAddress}/transactions`)) + const safeInstance = await getGnosisSafeInstanceAt(safeAddress) const from = userAccountSelector(state) const threshold = await safeInstance.getThreshold() @@ -47,7 +51,7 @@ const createTransaction = ( '', )}000000000000000000000000000000000000000000000000000000000000000001` - const notificationsQueue: NotificationsQueue = getNofiticationsFromTxType(notifiedTransaction) + const notificationsQueue: NotificationsQueue = getNotificationsFromTxType(notifiedTransaction) const beforeExecutionKey = showSnackbar(notificationsQueue.beforeExecution, enqueueSnackbar, closeSnackbar) let pendingExecutionKey @@ -99,6 +103,7 @@ const createTransaction = ( if (isExecution) { showSnackbar(notificationsQueue.afterExecution, enqueueSnackbar, closeSnackbar) } + dispatch(fetchTransactions(safeAddress)) return receipt.transactionHash }) @@ -114,8 +119,6 @@ const createTransaction = ( console.error(`Error executing the TX: ${errMsg}`) } - dispatch(fetchTransactions(safeAddress)) - return txHash } diff --git a/src/routes/safe/store/actions/processTransaction.js b/src/routes/safe/store/actions/processTransaction.js index d2ea959d..06ad45e4 100644 --- a/src/routes/safe/store/actions/processTransaction.js +++ b/src/routes/safe/store/actions/processTransaction.js @@ -6,6 +6,7 @@ import fetchTransactions from '~/routes/safe/store/actions/fetchTransactions' import { type GlobalState } from '~/store' import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts' import { + type NotifiedTransaction, getApprovalTransaction, getExecutionTransaction, CALL, @@ -16,7 +17,7 @@ import { import { type Notification, type NotificationsQueue, - getNofiticationsFromTxType, + getNotificationsFromTxType, showSnackbar, } from '~/logic/notifications' import { getErrorMessage } from '~/test/utils/ethereumErrors' @@ -68,7 +69,7 @@ const processTransaction = ( )}000000000000000000000000000000000000000000000000000000000000000001` } - const notificationsQueue: NotificationsQueue = getNofiticationsFromTxType(notifiedTransaction) + const notificationsQueue: NotificationsQueue = getNotificationsFromTxType(notifiedTransaction) const beforeExecutionKey = showSnackbar(notificationsQueue.beforeExecution, enqueueSnackbar, closeSnackbar) let pendingExecutionKey @@ -124,6 +125,7 @@ const processTransaction = ( shouldExecute ? TX_TYPE_EXECUTION : TX_TYPE_CONFIRMATION, ) showSnackbar(notificationsQueue.afterExecution, enqueueSnackbar, closeSnackbar) + dispatch(fetchTransactions(safeAddress)) return receipt.transactionHash }) @@ -137,8 +139,6 @@ const processTransaction = ( console.error(`Error executing the TX: ${errMsg}`) } - dispatch(fetchTransactions(safeAddress)) - return txHash }