Skip to content

Commit afb9861

Browse files
committed
feat: save last used project
1 parent 57d229a commit afb9861

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/twig/src/renderer/features/task-detail/components/TaskInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function TaskInput() {
7070

7171
const handleDirectoryChange = (newPath: string) => {
7272
setSelectedDirectory(newPath);
73-
setLastUsedDirectory(newPath);
73+
setLastUsedDirectory(newPath || null);
7474
};
7575

7676
const effectiveWorkspaceMode = workspaceMode;

apps/twig/src/renderer/stores/taskDirectoryStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface TaskDirectoryState {
1010
lastUsedDirectory: string | null;
1111
getTaskDirectory: (taskId: string, repoKey?: string) => string | null;
1212
setRepoDirectory: (repoKey: string, directory: string) => void;
13-
setLastUsedDirectory: (directory: string) => void;
13+
setLastUsedDirectory: (directory: string | null) => void;
1414
clearRepoDirectory: (repoKey: string) => void;
1515
validateLastUsedDirectory: () => Promise<void>;
1616
}
@@ -52,7 +52,7 @@ export const useTaskDirectoryStore = create<TaskDirectoryState>()(
5252
}));
5353
},
5454

55-
setLastUsedDirectory: (directory: string) => {
55+
setLastUsedDirectory: (directory: string | null) => {
5656
set({ lastUsedDirectory: directory });
5757
},
5858

0 commit comments

Comments
 (0)