дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
feat(app): Closing the last project window shows the welcome screen
Цей коміт міститься в:
1 джерело
a8ce8048f8
коміт
d9ff048a14
1 file changed
+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,
|
||||
|
||||
Reference in new issue
Заблокувати користувача