Skip to content

Commit

Permalink
fix go+ welcome command error
Browse files Browse the repository at this point in the history
  • Loading branch information
qinhongwei123 committed Nov 14, 2023
1 parent 30f39d6 commit c527d14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { GoExtensionContext } from './context';
import { extensionInfo } from './config';
import { getFromGlobalState, updateGlobalState } from './stateUtils';
import { createRegisterCommand } from './commands';
var packageJsonData = require('../package.json');

export class WelcomePanel {
public static activate(ctx: vscode.ExtensionContext, goCtx: GoExtensionContext) {
Expand Down Expand Up @@ -139,8 +140,8 @@ export class WelcomePanel {
const stylePath = joinPath(this.dataroot, 'welcome.css');
const announcePath = vscode.Uri.joinPath(this.dataroot, 'announce.png');
const gopherPath = joinPath(this.dataroot, 'goplus-logo-white.svg');
const goExtension = vscode.extensions.getExtension(extensionId)!;
const goExtensionVersion = goExtension.packageJSON.version;
const goExtension = vscode.extensions.getExtension(extensionId);
const goExtensionVersion = goExtension?.packageJSON.version ?? packageJsonData.version;

// Uri to load styles and images into webview
const scriptURI = webview.asWebviewUri(scriptPathOnDisk);
Expand Down

0 comments on commit c527d14

Please sign in to comment.