fix eth sign ordering

This commit is contained in:
Ilja 2022-02-16 15:53:23 +02:00
parent c94076a35c
commit 9ce7eae3ac
3 changed files with 5 additions and 9 deletions

View File

@ -26,11 +26,11 @@ export default function useWalletConnectEventsManager(initialized: boolean) {
const { method } = request const { method } = request
const requestSession = await walletConnectClient.session.get(topic) const requestSession = await walletConnectClient.session.get(topic)
console.log(method)
if ([EIP155_SIGNING_METHODS.ETH_SIGN, EIP155_SIGNING_METHODS.PERSONAL_SIGN].includes(method)) { if ([EIP155_SIGNING_METHODS.ETH_SIGN, EIP155_SIGNING_METHODS.PERSONAL_SIGN].includes(method)) {
ModalStore.open('SessionSignModal', { requestEvent, requestSession }) ModalStore.open('SessionSignModal', { requestEvent, requestSession })
} } else if (
if (
[ [
EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA, EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA,
EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA_V3, EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA_V3,
@ -38,9 +38,7 @@ export default function useWalletConnectEventsManager(initialized: boolean) {
].includes(method) ].includes(method)
) { ) {
ModalStore.open('SessionSignTypedDataModal', { requestEvent, requestSession }) ModalStore.open('SessionSignTypedDataModal', { requestEvent, requestSession })
} } else if (EIP155_SIGNING_METHODS.ETH_SEND_TRANSACTION) {
if (EIP155_SIGNING_METHODS.ETH_SEND_TRANSACTION) {
ModalStore.open('SessionSendTransactionModal', { requestEvent, requestSession }) ModalStore.open('SessionSendTransactionModal', { requestEvent, requestSession })
} }
}, []) }, [])

View File

@ -4,7 +4,7 @@ import { utils } from 'ethers'
* Truncates string (in the middle) via given lenght value * Truncates string (in the middle) via given lenght value
*/ */
export function truncate(value: string, length: number) { export function truncate(value: string, length: number) {
if (value.length <= length) { if (value?.length <= length) {
return value return value
} }

View File

@ -38,8 +38,6 @@ export default function SessionSendTransactionModal() {
const { name, icons, url } = requestSession.peer.metadata const { name, icons, url } = requestSession.peer.metadata
const transaction = params[0] const transaction = params[0]
console.log(transaction)
// Handle approve action // Handle approve action
async function onApprove() { async function onApprove() {
if (requestEvent) { if (requestEvent) {