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.
Цей коміт міститься в:
l0ng-ai committed 2026-10-24 17:38:13 +08:00
1 джерело 1332e1f584
коміт f3d86d8ac7
1 file changed
+2 -1
+2 -1
Переглянути файл
@@ -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());
}