fix(session): prefer current directory for implicit drafts
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user