diff --git a/src/components/ConnectButton/index.jsx b/src/components/ConnectButton/index.jsx index a00f1124..a20d5172 100644 --- a/src/components/ConnectButton/index.jsx +++ b/src/components/ConnectButton/index.jsx @@ -8,9 +8,10 @@ import Portis from '@portis/web3' import Fortmatic from 'fortmatic' import Button from '~/components/layout/Button' import { fetchProvider } from '~/logic/wallets/store/actions' +import { getNetwork } from '~/config' const web3Connect = new Web3Connect.Core({ - network: 'rinkeby', + network: getNetwork().toLowerCase(), providerOptions: { walletconnect: { package: WalletConnectProvider, @@ -39,15 +40,20 @@ type Props = { closeSnackbar: Function, } +let web3connectEventListenerAdded = false + const ConnectButton = ({ registerProvider, enqueueSnackbar, closeSnackbar, ...props }: Props) => { useEffect(() => { - web3Connect.on('connect', (provider: any) => { - if (provider) { - registerProvider(provider, enqueueSnackbar, closeSnackbar) - } - }) + if (!web3connectEventListenerAdded) { + web3Connect.on('connect', (provider: any) => { + if (provider) { + registerProvider(provider, enqueueSnackbar, closeSnackbar) + } + }) + web3connectEventListenerAdded = true + } }, []) return ( diff --git a/src/logic/notifications/notificationBuilder.js b/src/logic/notifications/notificationBuilder.js index d6527bf5..9b4fe24f 100644 --- a/src/logic/notifications/notificationBuilder.js +++ b/src/logic/notifications/notificationBuilder.js @@ -52,12 +52,12 @@ const cancellationTxNotificationsQueue: NotificationsQueue = { const ownerChangeTxNotificationsQueue: NotificationsQueue = { beforeExecution: NOTIFICATIONS.SIGN_OWNER_CHANGE_MSG, pendingExecution: { - noMoreConfirmationsNeeded: NOTIFICATIONS.ONWER_CHANGE_PENDING_MSG, - moreConfirmationsNeeded: NOTIFICATIONS.ONWER_CHANGE_PENDING_MORE_CONFIRMATIONS_MSG, + noMoreConfirmationsNeeded: NOTIFICATIONS.OWNER_CHANGE_PENDING_MSG, + moreConfirmationsNeeded: NOTIFICATIONS.OWNER_CHANGE_PENDING_MORE_CONFIRMATIONS_MSG, }, - afterRejection: NOTIFICATIONS.ONWER_CHANGE_REJECTED_MSG, + afterRejection: NOTIFICATIONS.OWNER_CHANGE_REJECTED_MSG, afterExecution: NOTIFICATIONS.OWNER_CHANGE_EXECUTED_MSG, - afterExecutionError: NOTIFICATIONS.ONWER_CHANGE_FAILED_MSG, + afterExecutionError: NOTIFICATIONS.OWNER_CHANGE_FAILED_MSG, } const safeNameChangeNotificationsQueue: NotificationsQueue = { diff --git a/src/logic/wallets/store/middlewares/providerWatcher.js b/src/logic/wallets/store/middlewares/providerWatcher.js new file mode 100644 index 00000000..e69de29b