We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9c581dd + c70ee1c commit 91cc738Copy full SHA for 91cc738
web-app/src/services/state/useStateMachine.tsx
@@ -33,12 +33,12 @@ const useStateMachine = (): Output => {
33
const listener = 'message'
34
// propograte channel event to state machine
35
const handler = (event: any) => {
36
- // NOTE: must call event.data, cannot destructure. VSCode acts odd
37
- const action = event.data
38
- // ignore browser events from other extensions
39
- if (action.source) {
+ // ensure events are coming from coderoad webview
+ if (!event.origin.match(/^vscode-webview/)) {
40
return
41
}
+ // NOTE: must call event.data, cannot destructure. VSCode acts odd
+ const action = event.data
42
sendWithLog(action)
43
44
window.addEventListener(listener, handler)
0 commit comments