Skip to content

Commit

Permalink
fix: handle unrecognized origin (#34)
Browse files Browse the repository at this point in the history
No longer throw a message on unrecognized origin. Simply return.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
jwartofsky-yext and github-actions[bot] authored Aug 28, 2024
1 parent 2b132b0 commit 059db80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/internal/hooks/useMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const useListenAndRespondMessage = (
return;
}
if (!targetOrigins.includes(origin)) {
throw new Error("Unrecognized origin");
return;
}

const { type }: ReceivePayloadInternal = data;
Expand Down

0 comments on commit 059db80

Please sign in to comment.