Skip to content

Commit

Permalink
fix: skip request if interaction id is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed Aug 10, 2023
1 parent ac6993a commit 30fa4b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/chrome/offscreen/message-handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createMessage } from 'chrome/messages/create-message'
import { ConnectorClient } from 'connector/connector-client'
import { MessagesRouter } from 'message-router'
import { ResultAsync, errAsync, okAsync } from 'neverthrow'
import { ResultAsync, errAsync, ok, okAsync } from 'neverthrow'
import { Queue } from 'queues/queue'
import { AppLogger, logger as appLogger } from 'utils/logger'
import {
Expand Down Expand Up @@ -75,6 +75,7 @@ export const OffscreenMessageHandler = (input: {
return messageRouter
.add(tabId!, interactionId, metadata)
.asyncAndThen(() => {
if (!interactionId) return okAsync(null)
if (message.data?.items?.discriminator === 'cancelRequest')
return dAppRequestQueue
.cancel(interactionId)
Expand Down

0 comments on commit 30fa4b1

Please sign in to comment.