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

Commit657ca17

Browse files
committed
exportable send function
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentd3cd169 commit657ca17

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

‎src/commands.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ interface CreateCommandProps {
2020
}
2121

2222
letsendToClient=(action:T.Action):void=>{
23-
/* */
23+
// function is replaced when webclient loads
2424
}
2525

26+
// This makes it easier to pass the send
27+
// function throughout the codebase
2628
exportconstsend=(action:T.Action):void=>{
2729
sendToClient(action)
2830
}
@@ -38,16 +40,15 @@ export const createCommands = ({ extensionPath, workspaceState }: CreateCommandP
3840
[COMMANDS.START]:async()=>{
3941
if(webview&&webview.state.loaded){
4042
webview.createOrShow()
41-
// make send to client function exportable
42-
// as "send". This makes it easier to pass the send
43-
// function throughout the codebase
44-
sendToClient=webview.send
4543
}else{
4644
// activate machine
4745
webview=createWebView({
4846
extensionPath,
4947
workspaceState,
5048
})
49+
// make send to client function exportable
50+
// as "send".
51+
sendToClient=webview.send
5152
}
5253
},
5354
[COMMANDS.CONFIG_TEST_RUNNER]:async(data:TT.Tutorial)=>{

‎src/services/webview/render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const getNonce = (): string => {
1212
returntext
1313
}
1414

15-
asyncfunctionrender(panel:vscode.WebviewPanel,rootPath:string){
15+
asyncfunctionrender(panel:vscode.WebviewPanel,rootPath:string):Promise<void>{
1616
try{
1717
// load copied index.html from web app build
1818
constdom=awaitJSDOM.fromFile(path.join(rootPath,'index.html'))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp