Skip to content

Commit ee60113

Browse files
authored
feat: allow opening existing projects from add project dialog (anomalyco#150)
1 parent 2309014 commit ee60113

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎packages/desktop/src/components/dialog-create-project.tsx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,12 @@ export const DialogCreateProject: Component = () => {
169169
}
170170

171171
function handleSelect(dir: DirectoryInfo | undefined) {
172-
if (!dir || dir.isExistingProject) return
172+
if (!dir) return
173+
if (dir.isExistingProject) {
174+
dialog.close()
175+
openProject(dir.path)
176+
return
177+
}
173178
setSelectedDir(dir)
174179
// Immediately add the project on selection
175180
handleAddExisting(dir)
@@ -217,7 +222,7 @@ export const DialogCreateProject: Component = () => {
217222
emptyMessage="No folders found"
218223
>
219224
{(dir) => (
220-
<div class="flex items-center gap-3 w-full" classList={{ "opacity-50": dir.isExistingProject }}>
225+
<div class="flex items-center gap-3 w-full">
221226
<span class="text-text-weak shrink-0">
222227
<Icon name={dir.isGitRepo ? "github" : "folder"} />
223228
</span>
@@ -230,7 +235,7 @@ export const DialogCreateProject: Component = () => {
230235
</Show>
231236
<Show when={dir.isExistingProject}>
232237
<span class="shrink-0 text-12-regular text-text-weak bg-surface-base px-2 py-0.5 rounded">
233-
added
238+
open
234239
</span>
235240
</Show>
236241
</div>

0 commit comments

Comments
 (0)