Fix button availability regression

This commit is contained in:
tidy-dev 2024-01-18 07:12:47 -05:00
parent b92c946653
commit 19ba6c87d3
2 changed files with 5 additions and 8 deletions

View file

@ -44,7 +44,7 @@ export function canStartOperation(
return false
}
return statusKind === ComputedAction.Clean
return statusKind !== ComputedAction.Invalid
}
export interface IBaseChooseBranchDialogProps {

View file

@ -116,17 +116,14 @@ export class MergeChooseBranchDialog extends React.Component<
return
}
// The clean status is the only one that needs the ahead/behind count. If
// the status is conflicts or invalid, update the UI here and end the
// function.
if (
mergeStatus.kind === ComputedAction.Conflicts ||
mergeStatus.kind === ComputedAction.Invalid
) {
// Can't go forward if the merge status is invalid, no need to check commit count
if (mergeStatus.kind === ComputedAction.Invalid) {
this.setState({ mergeStatus })
return
}
// Commit count is used in the UI output as well as determining whether the
// submit button is enabled
const range = revSymmetricDifference('', branch.name)
const aheadBehind = await getAheadBehind(this.props.repository, range)
const commitCount = aheadBehind ? aheadBehind.behind : 0