Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc70ee1c

Browse files
committed
ensure events come from cr webview
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent9c581dd commitc70ee1c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎web-app/src/services/state/useStateMachine.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ const useStateMachine = (): Output => {
3333
constlistener='message'
3434
// propograte channel event to state machine
3535
consthandler=(event:any)=>{
36-
// NOTE: must call event.data, cannot destructure. VSCode acts odd
37-
constaction=event.data
38-
// ignore browser events from other extensions
39-
if(action.source){
36+
// ensure events are coming from coderoad webview
37+
if(!event.origin.match(/^vscode-webview/)){
4038
return
4139
}
40+
// NOTE: must call event.data, cannot destructure. VSCode acts odd
41+
constaction=event.data
4242
sendWithLog(action)
4343
}
4444
window.addEventListener(listener,handler)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp