From f3d86d8ac720c0d3b6249b242d1d5b1305304bd4 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 24 Oct 2026 17:38:13 +0800 Subject: [PATCH] fix(settings): Keep Settings for New Projects when the launch is taken first The settings window reads its launch twice (the launch listener and the initial open). When the listener won, the initial open reset the mode to regular Settings. --- src/features/settings/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features/settings/index.ts b/src/features/settings/index.ts index c09d66158..d7f440d17 100644 --- a/src/features/settings/index.ts +++ b/src/features/settings/index.ts @@ -186,8 +186,9 @@ export function activateSettingsWindow(parent: string): () => void { const project = await commands.projectCurrent().catch(() => null); if (project) useProject.setState({ project, settings: project.settings }); else await loadSettings().catch((e) => console.warn("cannot load settings", e)); + // `listenLaunch` may have taken the launch first and applied it already. const launch = await takeLaunch(); - openSettings(launch?.page, { newProjects: launch?.newProjects }); + openSettings(launch?.page, { newProjects: launch?.newProjects ?? useSettingsDialog.getState().newProjects }); })(); return () => disposers.reverse().forEach((d) => d()); }