Skip to content

Commit

Permalink
Fix panel not active message for #389.
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Hopkinson committed Mar 20, 2023
1 parent ea7323d commit 3550ada
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 6 additions & 13 deletions src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export function storeCollectionAsMemento(
]);
}

let petPlaygroundStatusBar: vscode.StatusBarItem;
let spawnPetStatusBar: vscode.StatusBarItem;

interface IPetInfo {
Expand Down Expand Up @@ -309,14 +308,6 @@ export function activate(context: vscode.ExtensionContext) {
}),
);

// status bar item
petPlaygroundStatusBar = vscode.window.createStatusBarItem(
vscode.StatusBarAlignment.Right,
100,
);
petPlaygroundStatusBar.command = 'vscode-pets.start';
context.subscriptions.push(petPlaygroundStatusBar);

spawnPetStatusBar = vscode.window.createStatusBarItem(
vscode.StatusBarAlignment.Right,
100,
Expand Down Expand Up @@ -491,6 +482,12 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand('vscode-pets.spawn-pet', async () => {
const panel = getPetPanel();
if (
getConfigurationPosition() === ExtPosition.explorer &&
webviewViewProvider
) {
vscode.commands.executeCommand('petsView.focus');
}
if (panel) {
const selectedPetType = await vscode.window.showQuickPick(
localize.stringListAsQuickPickItemList<PetType>(ALL_PETS),
Expand Down Expand Up @@ -643,10 +640,6 @@ function updateStatusBar(): void {
spawnPetStatusBar.show();
}

export function petPlaygroundDeactivate() {
petPlaygroundStatusBar.dispose();
}

export function spawnPetDeactivate() {
spawnPetStatusBar.dispose();
}
Expand Down

0 comments on commit 3550ada

Please sign in to comment.