fix: prevent Create button stuck disabled on repo re-select (#580)

This commit is contained in:
Neil
2026-04-12 23:31:18 -07:00
committed by GitHub
parent fead39f00d
commit d7e045b19a
@@ -263,6 +263,13 @@ const AddWorktreeDialog = React.memo(function AddWorktreeDialog() {
const handleRepoChange = useCallback(
(value: string) => {
// Why: re-selecting the already-active repo resets checkedHooksRepoId and
// hasLoadedIssueCommand to null/false, but the useEffect that reloads them
// depends on [isOpen, repoId] — since repoId didn't change the effect never
// re-fires, leaving the Create button permanently disabled.
if (value === repoId) {
return
}
setRepoId(value)
setYamlHooks(null)
setCheckedHooksRepoId(null)
@@ -276,7 +283,7 @@ const AddWorktreeDialog = React.memo(function AddWorktreeDialog() {
setCreateError(null)
}
},
[createError]
[createError, repoId]
)
const handleOpenSetupSettings = useCallback(() => {