fix(session): prefer current directory for implicit drafts

This commit is contained in:
Bohdan Triapitsyn
2026-06-24 00:43:19 +03:00
parent 08b866136e
commit 7f8e04d22f
3 changed files with 8 additions and 8 deletions
-3
View File
@@ -626,7 +626,6 @@ export const useSessionUIStore = create<SessionUIState>()((set, get) => ({
if (explicitProject || explicitDirectory !== null) {
return explicitProject ?? inferredProjectFromDir ?? fallbackProject
}
if (activeProject) return activeProject
if (currentDirectory) return currentDirProject ?? fallbackProject
return persistedProjectByDir ?? persistedProjectById ?? fallbackProject
})()
@@ -634,8 +633,6 @@ export const useSessionUIStore = create<SessionUIState>()((set, get) => ({
const directory = (() => {
if (explicitDirectory !== null) return explicitDirectory
if (explicitProject) return normalizePath(explicitProject.path ?? null)
const selectedProjectPath = normalizePath(selectedProject?.path ?? null)
if (selectedProjectPath && selectedProjectPath !== currentDirectory) return selectedProjectPath
if (currentDirectory) return currentDirectory
if (persistedTarget?.directory) return persistedTarget.directory
return normalizePath(selectedProject?.path ?? null)