Skip to content

Commit

Permalink
refactor: modify sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgao365 committed Feb 28, 2024
1 parent b8d0d0c commit 919939c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/vue/extension/views/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { Disposable, ExtensionContext, Webview, window } from 'vscode';

export class WebviewHelper {
public static setupHtml(webview: Webview, context: ExtensionContext) {
if (process.env.VITE_DEV_SERVER_URL) {
return __getWebviewHtml__(process.env.VITE_DEV_SERVER_URL);
}
return __getWebviewHtml__(webview, context);
return process.env.VITE_DEV_SERVER_URL
? __getWebviewHtml__(process.env.VITE_DEV_SERVER_URL)
: __getWebviewHtml__(webview, context);
}

public static setupWebviewHooks(webview: Webview, disposables: Disposable[]) {
Expand Down

0 comments on commit 919939c

Please sign in to comment.