fix: propagate electron params in second instance startup (#2686)

This commit is contained in:
Giacomo Cusinato 2025-04-05 19:56:00 +09:00 committed by GitHub
parent e36f393682
commit 56ab874177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -385,10 +385,11 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
}
private async launchFromArgs(
params: ElectronMainCommandOptions
params: ElectronMainCommandOptions,
argv?: string[]
): Promise<boolean> {
// Copy to prevent manipulation of original array
const argCopy = [...this.argv];
const argCopy = [...(argv || this.argv)];
let path: string | undefined;
for (const maybePath of argCopy) {
const resolvedPath = await this.resolvePath(maybePath, params.cwd);
@ -526,7 +527,7 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
argv: string[],
cwd: string
): Promise<void> {
if (await this.launchFromArgs({ cwd, secondInstance: true })) {
if (await this.launchFromArgs({ cwd, secondInstance: true }, argv)) {
// Application has received a file in its arguments
return;
}