diff --git a/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts b/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts index b182de4..032bb1f 100644 --- a/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts +++ b/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts @@ -26,11 +26,11 @@ export default function useWalletConnectEventsManager(initialized: boolean) { const { method } = request const requestSession = await walletConnectClient.session.get(topic) + console.log(method) + if ([EIP155_SIGNING_METHODS.ETH_SIGN, EIP155_SIGNING_METHODS.PERSONAL_SIGN].includes(method)) { ModalStore.open('SessionSignModal', { requestEvent, requestSession }) - } - - if ( + } else if ( [ EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA, EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA_V3, @@ -38,9 +38,7 @@ export default function useWalletConnectEventsManager(initialized: boolean) { ].includes(method) ) { ModalStore.open('SessionSignTypedDataModal', { requestEvent, requestSession }) - } - - if (EIP155_SIGNING_METHODS.ETH_SEND_TRANSACTION) { + } else if (EIP155_SIGNING_METHODS.ETH_SEND_TRANSACTION) { ModalStore.open('SessionSendTransactionModal', { requestEvent, requestSession }) } }, []) diff --git a/wallets/react-wallet-v2/src/utils/HelperUtil.ts b/wallets/react-wallet-v2/src/utils/HelperUtil.ts index 0703c53..86ea4b9 100644 --- a/wallets/react-wallet-v2/src/utils/HelperUtil.ts +++ b/wallets/react-wallet-v2/src/utils/HelperUtil.ts @@ -4,7 +4,7 @@ import { utils } from 'ethers' * Truncates string (in the middle) via given lenght value */ export function truncate(value: string, length: number) { - if (value.length <= length) { + if (value?.length <= length) { return value } diff --git a/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx b/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx index c288576..7b024a4 100644 --- a/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx +++ b/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx @@ -38,8 +38,6 @@ export default function SessionSendTransactionModal() { const { name, icons, url } = requestSession.peer.metadata const transaction = params[0] - console.log(transaction) - // Handle approve action async function onApprove() { if (requestEvent) {