Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sandbox stuck loading #3325

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/webview/cluster/clusterViewLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@
await cfg.update('crcNameserver', event.nameserver);
}

// eslint-disable-next-line @typescript-eslint/require-await
static async loadView(title: string): Promise<vscode.WebviewPanel> {
const localResourceRoot = vscode.Uri.file(path.join(ClusterViewLoader.extensionPath, 'out', 'clusterViewer'));
if (panel) {
Expand All @@ -372,11 +371,13 @@
});
panel.iconPath = vscode.Uri.file(path.join(ClusterViewLoader.extensionPath, 'images/context/cluster-node.png'));
panel.webview.html = await loadWebviewHtml('clusterViewer', panel);
await panel.webview.postMessage({action: 'cluster', data: ''});
const messageListenerDisposable = panel.webview.onDidReceiveMessage(clusterEditorMessageListener);

Check warning on line 374 in src/webview/cluster/clusterViewLoader.ts

View check run for this annotation

Codecov / codecov/patch

src/webview/cluster/clusterViewLoader.ts#L374

Added line #L374 was not covered by tests
panel.onDidDispose(()=> {
messageListenerDisposable.dispose();

Check warning on line 376 in src/webview/cluster/clusterViewLoader.ts

View check run for this annotation

Codecov / codecov/patch

src/webview/cluster/clusterViewLoader.ts#L376

Added line #L376 was not covered by tests
panel = undefined;
});
panel.webview.onDidReceiveMessage(clusterEditorMessageListener);
// don't await this message being sent, since the webview may not be set up yet
void panel.webview.postMessage({action: 'cluster', data: ''});

Check warning on line 380 in src/webview/cluster/clusterViewLoader.ts

View check run for this annotation

Codecov / codecov/patch

src/webview/cluster/clusterViewLoader.ts#L380

Added line #L380 was not covered by tests
}
return panel;
}
Expand Down
Loading