fix: [code-1153]: fix recheck condition (#851)

This commit is contained in:
Calvin Lee 2023-12-02 00:08:55 +00:00 committed by Harness
parent 6174525df5
commit 32620e8159
2 changed files with 8 additions and 3 deletions

View File

@ -196,7 +196,7 @@ export const Conversation: React.FC<ConversationProps> = ({
boxClassName={css.commentBox}
editorClassName={css.commentEditor}
commentItems={[]}
currentUserName={currentUser.display_name}
currentUserName={currentUser.display_name || currentUser.email || ''}
resetOnSave
hideCancel={false}
setDirty={setDirtyNewComment}

View File

@ -135,9 +135,13 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
})
}
}
useEffect(() => {
dryMerge() // eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
// recheck PR in case source SHA changed or PR was marked as unchecked
// TODO: optimize call to handle all causes and avoid double calls by keeping track of SHA
dryMerge()
}, [unchecked, pullRequestMetadata?.source_sha]) // eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(() => {
// dryMerge()
const intervalId = setInterval(async () => {
@ -208,6 +212,7 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
setMergeOption(mergeOptions[3])
} // eslint-disable-next-line react-hooks/exhaustive-deps
}, [allowedStrats])
const [draftOption, setDraftOption] = useState<PRDraftOption>(draftOptions[0])
const permPushResult = hooks?.usePermissionTranslate?.(
{