Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(desktop): drop the stale open reference in the create project dialog

vastsa9a1804c32a24
diff --git a/apps/desktop/src/components/ProjectCreateDialog.tsx b/apps/desktop/src/components/ProjectCreateDialog.tsx
index 4b80d878f..a649b78e4 100644
--- a/apps/desktop/src/components/ProjectCreateDialog.tsx
+++ b/apps/desktop/src/components/ProjectCreateDialog.tsx
@@ -40,6 +40,8 @@ function samePath(left: string, right: string) {
right.trim().replace(/\\/g, "/").replace(/\/+$/, "");
}
+// The create dialog mounts its content only while open: the blocking overlay
+// registers with that mounted subtree, and every reopen resets the form.
export function ProjectCreateDialog() {
const { t } = useTranslation();
const open = useAppStore((state) => state.createProjectDialogOpen);
@@ -126,7 +128,7 @@ function ProjectCreateDialogContent() {
document.body.style.overflow = previousOverflow;
if (previouslyFocused?.isConnected) previouslyFocused.focus();
};
- }, [close, open]);
+ }, [close]);
// The first folder or the repository name fills the field until the user
// types their own name; an emptied field still falls back to it on submit.
@@ -135,8 +137,6 @@ function ProjectCreateDialogContent() {
setName(defaultName);
}, [defaultName]);
- if (!open) return null;
-
const addFolders = async () => {
if (busyRef.current || folderPickerInFlightRef.current) return;
folderPickerInFlightRef.current = true;