Skip to content

Commit

Permalink
nit: listener fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dalechyn committed Nov 5, 2024
1 parent cee65ee commit 9f3263b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ export function listenForJsonRpcResponseMessage<resultType>(
JsonRpcResponseSuccess<resultType> | JsonRpcResponseFailure
>,
) => {
if (event.data.id !== requestId) return

if (
event.data.id !== requestId ||
!('result' in event.data || 'error' in event.data)
)
return
handler(event.data)
}

Expand Down

0 comments on commit 9f3263b

Please sign in to comment.