fix: [code-2105]: fix available merge strats (#2206)

* fix: [code-2105]: fix available merge strats
unified-ui
Calvin Lee 2024-07-11 18:00:08 +00:00 committed by Harness
parent 4ac42fc6c9
commit feecde9faa
1 changed files with 5 additions and 1 deletions

View File

@ -209,7 +209,11 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
if (allowedStrats) {
const matchingMethods = mergeOptions.filter(option => allowedStrats.includes(option.method))
if (matchingMethods.length > 0) {
setMergeOption(mergeOption ? mergeOption : matchingMethods[0])
if (mergeOption && !matchingMethods.includes(mergeOption)) {
setMergeOption(matchingMethods[0])
} else {
setMergeOption(mergeOption)
}
}
} else {
setMergeOption(mergeOptions[3])