mirror of
https://github.com/desktop/desktop
synced 2024-09-19 08:02:22 +00:00
Tidying
This commit is contained in:
parent
fe58e21158
commit
c3f74f57eb
|
@ -776,7 +776,7 @@ export interface ICherryPickState {
|
|||
readonly targetBranchUndoSha: string | null
|
||||
|
||||
/**
|
||||
* Whether branch was created during cherry-pick operation
|
||||
* Whether the target branch was created during cherry-pick operation
|
||||
*/
|
||||
readonly branchCreated: boolean
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ export class CherryPickFlow extends React.Component<ICherryPickFlowProps> {
|
|||
const { dispatcher, repository, commits, sourceBranch } = this.props
|
||||
if (this.props.step.kind !== CherryPickStepKind.CreateBranch) {
|
||||
log.warn(
|
||||
'[cherryPickFlow] - onBranchCreated should only be called during a create branch step.'
|
||||
'[cherryPickFlow] - Invalid cherry-picking state for creating a branch.'
|
||||
)
|
||||
this.onFlowEnded()
|
||||
return
|
||||
|
|
|
@ -106,13 +106,10 @@ export class ChooseTargetBranchDialog extends React.Component<
|
|||
}
|
||||
|
||||
private canCherryPickOntoSelectedBranch() {
|
||||
const {
|
||||
selectedBranch,
|
||||
isCreateBranchState: isNoBranchesState,
|
||||
} = this.state
|
||||
const { selectedBranch, isCreateBranchState } = this.state
|
||||
return (
|
||||
(selectedBranch !== null && !this.selectedBranchIsCurrentBranch()) ||
|
||||
isNoBranchesState
|
||||
isCreateBranchState
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -127,12 +124,9 @@ export class ChooseTargetBranchDialog extends React.Component<
|
|||
}
|
||||
|
||||
private renderOkButtonText() {
|
||||
const {
|
||||
selectedBranch,
|
||||
isCreateBranchState: isNoBranchesState,
|
||||
} = this.state
|
||||
const { selectedBranch, isCreateBranchState } = this.state
|
||||
|
||||
if (isNoBranchesState) {
|
||||
if (isCreateBranchState) {
|
||||
return __DARWIN__
|
||||
? 'Cherry-pick to New Branch'
|
||||
: 'Cherry-pick to new branch'
|
||||
|
@ -153,10 +147,10 @@ export class ChooseTargetBranchDialog extends React.Component<
|
|||
}
|
||||
|
||||
private onFilterListResultsChanged = (resultCount: number) => {
|
||||
const { isCreateBranchState: isNoBranchesState } = this.state
|
||||
if (resultCount === 0 && !isNoBranchesState) {
|
||||
const { isCreateBranchState } = this.state
|
||||
if (resultCount === 0 && !isCreateBranchState) {
|
||||
this.setState({ isCreateBranchState: true })
|
||||
} else if (resultCount > 0 && isNoBranchesState) {
|
||||
} else if (resultCount > 0 && isCreateBranchState) {
|
||||
this.setState({ isCreateBranchState: false })
|
||||
}
|
||||
}
|
||||
|
@ -209,8 +203,8 @@ export class ChooseTargetBranchDialog extends React.Component<
|
|||
}
|
||||
|
||||
private onSubmit = async () => {
|
||||
const { isCreateBranchState: isNoBranchesState, filterText } = this.state
|
||||
if (isNoBranchesState) {
|
||||
const { isCreateBranchState, filterText } = this.state
|
||||
if (isCreateBranchState) {
|
||||
this.props.onCreateNewBranch(filterText)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ interface ICreateBranchProps {
|
|||
readonly okButtonText?: string
|
||||
|
||||
/**
|
||||
* If provided use, as the header
|
||||
* If provided, use as the header
|
||||
*/
|
||||
readonly headerText?: string
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue