fix(wallet): ensures legacy v1 modals handle JsonRpcError vs
JsonRpcResult
This commit is contained in:
parent
c128875314
commit
c699860663
@ -32,16 +32,24 @@ export default function LegacySessionSendTransactionModal() {
|
||||
// Handle approve action
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
const { result } = await approveEIP155Request({
|
||||
const response = await approveEIP155Request({
|
||||
id,
|
||||
topic: '',
|
||||
params: { request: { method, params }, chainId: '1' }
|
||||
})
|
||||
|
||||
legacySignClient.approveRequest({
|
||||
id,
|
||||
result
|
||||
})
|
||||
if ('error' in response) {
|
||||
legacySignClient.rejectRequest({
|
||||
id,
|
||||
error: response.error
|
||||
})
|
||||
} else {
|
||||
legacySignClient.approveRequest({
|
||||
id,
|
||||
result: response.result
|
||||
})
|
||||
}
|
||||
|
||||
ModalStore.close()
|
||||
}
|
||||
}
|
||||
|
@ -28,16 +28,24 @@ export default function LegacySessionSignModal() {
|
||||
// Handle approve action (logic varies based on request method)
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
const { result } = await approveEIP155Request({
|
||||
const response = await approveEIP155Request({
|
||||
id,
|
||||
topic: '',
|
||||
params: { request: { method, params }, chainId: '1' }
|
||||
})
|
||||
|
||||
legacySignClient.approveRequest({
|
||||
id,
|
||||
result
|
||||
})
|
||||
if ('error' in response) {
|
||||
legacySignClient.rejectRequest({
|
||||
id,
|
||||
error: response.error
|
||||
})
|
||||
} else {
|
||||
legacySignClient.approveRequest({
|
||||
id,
|
||||
result: response.result
|
||||
})
|
||||
}
|
||||
|
||||
ModalStore.close()
|
||||
}
|
||||
}
|
||||
|
@ -29,16 +29,24 @@ export default function LegacySessionSignTypedDataModal() {
|
||||
// Handle approve action (logic varies based on request method)
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
const { result } = await approveEIP155Request({
|
||||
const response = await approveEIP155Request({
|
||||
id,
|
||||
topic: '',
|
||||
params: { request: { method, params }, chainId: '1' }
|
||||
})
|
||||
|
||||
legacySignClient.approveRequest({
|
||||
id,
|
||||
result
|
||||
})
|
||||
if ('error' in response) {
|
||||
legacySignClient.rejectRequest({
|
||||
id,
|
||||
error: response.error
|
||||
})
|
||||
} else {
|
||||
legacySignClient.approveRequest({
|
||||
id,
|
||||
result: response.result
|
||||
})
|
||||
}
|
||||
|
||||
ModalStore.close()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user