Skip to content

Commit

Permalink
Merge pull request #411 from Harry-Hopkinson/fix-panel-not-active-err…
Browse files Browse the repository at this point in the history
…or-message-for-#389

Fix panel not active message.
  • Loading branch information
tonybaloney authored Jul 4, 2023
2 parents 05c12e1 + 418f4e8 commit 67d51c4
Showing 1 changed file with 6 additions and 13 deletions.
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 67d51c4

Please sign in to comment.