feat(app): Closing the last project window shows the welcome screen

Цей коміт міститься в:
l0ng-ai committed 2026-10-27 22:20:25 +08:00
1 джерело a8ce8048f8
коміт d9ff048a14
1 file changed
+7 -1
+7 -1
Переглянути файл
@@ -9,7 +9,7 @@
*/
import { commands, isTauri, onIdeEvent, type Settings } from "@/platform/ipc";
import { t } from "@/platform/i18n";
import { provideLeaveProjectGuard, useProject } from "@/platform/project";
import { closeProject, provideLeaveProjectGuard, useProject } from "@/platform/project";
import { maybeEditorService, notifications } from "@/workbench/contributions";
import { ask, type Ask } from "@/workbench/messages";
@@ -99,6 +99,12 @@ async function onCloseRequested(deps: CloseDeps): Promise<boolean> {
try {
const ctx = await commands.windowCloseContext();
const s = useProject.getState();
// Closing the last project window closes its project and shows the welcome screen
// (to open another one); closing the welcome screen, or quitting, closes the window.
if (!ctx.quitting && ctx.windows <= 1 && s.project) {
if (await confirmLeave(deps)) await closeProject();
return false;
}
const ok = await decideClose(
{
quitting: ctx.quitting,