| ... | @@ -550,6 +550,8 @@ export default function Sidebar() { | ... | @@ -550,6 +550,8 @@ export default function Sidebar() { |
| 550 | void addProjectFromPath(newCwd); | 550 | void addProjectFromPath(newCwd); |
| 551 | }; | 551 | }; |
| 552 | | 552 | |
| | 553 | const canAddProject = newCwd.trim().length > 0 && !isAddingProject; |
| | 554 | |
| 553 | const handlePickFolder = async () => { | 555 | const handlePickFolder = async () => { |
| 554 | const api = readNativeApi(); | 556 | const api = readNativeApi(); |
| 555 | if (!api || isPickingFolder) return; | 557 | if (!api || isPickingFolder) return; |
| ... | @@ -1223,7 +1225,7 @@ export default function Sidebar() { | ... | @@ -1223,7 +1225,7 @@ export default function Sidebar() { |
| 1223 | type="button" | 1225 | type="button" |
| 1224 | className="shrink-0 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground transition-colors duration-150 hover:bg-primary/90 disabled:opacity-60" | 1226 | className="shrink-0 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground transition-colors duration-150 hover:bg-primary/90 disabled:opacity-60" |
| 1225 | onClick={handleAddProject} | 1227 | onClick={handleAddProject} |
| 1226 | disabled={isAddingProject} | 1228 | disabled={!canAddProject} |
| 1227 | > | 1229 | > |
| 1228 | {isAddingProject ? "Adding..." : "Add"} | 1230 | {isAddingProject ? "Adding..." : "Add"} |
| 1229 | </button> | 1231 | </button> |