Skip to content

Commit 7804d04

Browse files
committed
load current
1 parent 4feed76 commit 7804d04

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/editor/ReactWebView.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ReactWebView {
3131
console.log('webview loaded')
3232
}
3333

34-
public async createOrShow(column: number): Promise<void> {
34+
public createOrShow(column: number): void {
3535
// If we already have a panel, show it.
3636
// Otherwise, create a new panel.
3737
if (this.panel && this.panel.webview) {
@@ -40,7 +40,6 @@ class ReactWebView {
4040
} else {
4141
console.log('make new panel')
4242
this.panel = this.createWebviewPanel(column)
43-
4443
}
4544
}
4645

src/editor/commands/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ export const createCommands = ({ context, machine, storage, git, position }: Cre
4343
// open React webview
4444
[COMMANDS.OPEN_WEBVIEW]: (column: number = vscode.ViewColumn.One) => {
4545
webview.createOrShow(column);
46+
setTimeout(() => {
47+
machine.send('WEBVIEW_INITIALIZED')
48+
}, 2000)
4649
},
4750
// launch a new tutorial
4851
// NOTE: may be better to move into action as logic is primarily non-vscode

typings/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export interface MachineStateSchema {
148148
states: {
149149
Initialize: {}
150150
Summary: {}
151+
LoadCurrent: {}
151152
LoadNext: {}
152153
Level: {}
153154
Stage: {

0 commit comments

Comments
 (0)