@@ -256,7 +256,7 @@ export const OfferToUpdate = ({ mergeable, isSimple, isCurrentlyCheckedOut, canU
256256 const update = ( ) => {
257257 setBusy ( true ) ;
258258 updateBranch ( ) . finally ( ( ) => setBusy ( false ) ) ;
259- }
259+ } ;
260260 if ( ! canUpdateBranch || ! isCurrentlyCheckedOut || isSimple || mergeable === PullRequestMergeability . Behind || mergeable === PullRequestMergeability . Conflict || mergeable === PullRequestMergeability . Unknown ) {
261261 return null ;
262262 }
@@ -420,7 +420,7 @@ export const DeleteBranch = (pr: PullRequest) => {
420420function ConfirmMerge ( { pr, method, cancel } : { pr : PullRequest ; method : MergeMethod ; cancel : ( ) => void } ) {
421421 const { merge, updatePR, changeEmail } = useContext ( PullRequestContext ) ;
422422 const [ isBusy , setBusy ] = useState ( false ) ;
423-
423+ const emailForCommit = pr . emailForCommit ;
424424 return (
425425 < div >
426426 < form id = 'merge-comment-form'
@@ -434,7 +434,7 @@ function ConfirmMerge({ pr, method, cancel }: { pr: PullRequest; method: MergeMe
434434 title : title ?. value ,
435435 description : description ?. value ,
436436 method,
437- email : pr . emailForCommit
437+ email : emailForCommit
438438 } ) ;
439439 updatePR ( { state } ) ;
440440 } finally {
@@ -444,13 +444,13 @@ function ConfirmMerge({ pr, method, cancel }: { pr: PullRequest; method: MergeMe
444444 >
445445 { method === 'rebase' ? null : ( < input type = "text" name = "title" defaultValue = { getDefaultTitleText ( method , pr ) } /> ) }
446446 { method === 'rebase' ? null : ( < textarea name = "description" defaultValue = { getDefaultDescriptionText ( method , pr ) } /> ) }
447- { method === 'rebase' ? null : (
447+ { ( method === 'rebase' || ! emailForCommit ) ? null : (
448448 < div className = 'commit-association' >
449449 < span >
450450 Commit will be associated with < button className = 'input-box' title = 'Change email' aria-label = 'Change email' disabled = { isBusy } onClick = { ( ) => {
451451 setBusy ( true ) ;
452- changeEmail ( pr . emailForCommit ) . finally ( ( ) => setBusy ( false ) ) ;
453- } } > { pr . emailForCommit } </ button >
452+ changeEmail ( emailForCommit ) . finally ( ( ) => setBusy ( false ) ) ;
453+ } } > { emailForCommit } </ button >
454454 </ span >
455455 </ div >
456456 ) }
0 commit comments