Skip to content

Commit

Permalink
Fixes launchpad/open event always being sent on extension load (#3289)
Browse files Browse the repository at this point in the history
  • Loading branch information
axosoft-ramint committed May 14, 2024
1 parent 695adba commit 705661b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/system/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isWebviewContext } from './webview';

export type CommandCallback = Parameters<typeof commands.registerCommand>[1];

type CommandConstructor = new (container: Container) => Command;
type CommandConstructor = new (container: Container, ...args: any[]) => Command;
const registrableCommands: CommandConstructor[] = [];

export function command(): ClassDecorator {
Expand Down Expand Up @@ -54,7 +54,9 @@ export function registerWebviewCommand(command: string, callback: CommandCallbac
}

export function registerCommands(container: Container): Disposable[] {
return registrableCommands.map(c => new c(container));
return registrableCommands.map(c =>
c.name === 'FocusCommand' ? new c(container, undefined, true) : new c(container),
);
}

export function asCommand<T extends unknown[]>(
Expand Down

0 comments on commit 705661b

Please sign in to comment.