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

Commit9c530c9

Browse files
committed
update state in client
1 parentb50e2c0 commit9c530c9

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

‎src/editor/commands/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export const createCommands = ({ context, machine, storage, git }: CreateCommand
5454
initialProgress=progress
5555
constcanContinue=!!(tutorial&&progress&&hasGit&&hasGitRemote)
5656
console.log('canContinue',canContinue)
57-
// if a tutorial exists,"CONTINUE"
58-
// otherwise start from"NEW"
57+
// if a tutorial exists,'CONTINUE'
58+
// otherwise start from'NEW'
5959
machine.send(canContinue ?'CONTINUE' :'NEW')
6060
},
6161
// open React webview
@@ -78,15 +78,13 @@ export const createCommands = ({ context, machine, storage, git }: CreateCommand
7878
}
7979
},
8080
// send messages to webview
81-
[COMMANDS.SEND_STATE]:(action:CR.Action)=>{
82-
console.log(`SEND${JSON.stringify(action)}`)
83-
console.log('webview')
84-
console.log(webview)
81+
[COMMANDS.SEND_STATE]:(payload:any)=>{
82+
console.log(`SEND${JSON.stringify(payload)}`)
8583
// console.log(webview.currentPanel)
8684
// if (!webview || !webview.currentPanel) {
8785
// throw new Error('No valid panel available')
8886
// }
89-
webview.postMessage(action)
87+
webview.postMessage({type:'SET_STATE', payload})
9088

9189
}
9290
})

‎web-app/src/Routes.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ interface ReceivedEvent {
88
constRoutes=()=>{
99
const[state,setState]=React.useState({SelectTutorial:'Initial'})
1010
consthandleEvent=(event:ReceivedEvent):void=>{
11-
console.log('--- HANDLE EVENT ---')
1211
constmessage=event.data
1312
console.log(`RECEIVED:${JSON.stringify(message)}`)
1413
// messages from core

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp