mirror of
https://github.com/desktop/desktop
synced 2024-09-19 08:02:22 +00:00
Show fork settings dialog after forking a repository
This commit is contained in:
parent
f5bb6bcd96
commit
30fe24ccf8
|
@ -2081,8 +2081,8 @@ export class Dispatcher {
|
|||
public async convertRepositoryToFork(
|
||||
repository: RepositoryWithGitHubRepository,
|
||||
fork: IAPIRepository
|
||||
) {
|
||||
await this.appStore._convertRepositoryToFork(repository, fork)
|
||||
): Promise<Repository> {
|
||||
return this.appStore._convertRepositoryToFork(repository, fork)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,12 +6,16 @@ import {
|
|||
DefaultDialogFooter,
|
||||
} from '../dialog'
|
||||
import { Dispatcher } from '../dispatcher'
|
||||
import { RepositoryWithGitHubRepository } from '../../models/repository'
|
||||
import {
|
||||
RepositoryWithGitHubRepository,
|
||||
isRepositoryWithForkedGitHubRepository,
|
||||
} from '../../models/repository'
|
||||
import { OkCancelButtonGroup } from '../dialog/ok-cancel-button-group'
|
||||
import { sendNonFatalException } from '../../lib/helpers/non-fatal-exception'
|
||||
import { Account } from '../../models/account'
|
||||
import { API } from '../../lib/api'
|
||||
import { LinkButton } from '../lib/link-button'
|
||||
import { PopupType } from '../../models/popup'
|
||||
|
||||
interface ICreateForkDialogProps {
|
||||
readonly dispatcher: Dispatcher
|
||||
|
@ -49,12 +53,19 @@ export class CreateForkDialog extends React.Component<
|
|||
gitHubRepository.name
|
||||
)
|
||||
this.props.dispatcher.recordForkCreated()
|
||||
await this.props.dispatcher.convertRepositoryToFork(
|
||||
const updatedRepository = await this.props.dispatcher.convertRepositoryToFork(
|
||||
this.props.repository,
|
||||
fork
|
||||
)
|
||||
this.setState({ loading: false })
|
||||
this.props.onDismissed()
|
||||
|
||||
if (isRepositoryWithForkedGitHubRepository(updatedRepository)) {
|
||||
this.props.dispatcher.showPopup({
|
||||
type: PopupType.ChooseForkSettings,
|
||||
repository: updatedRepository,
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
log.error(`Fork creation through API failed (${e})`)
|
||||
sendNonFatalException('forkCreation', e)
|
||||
|
|
Loading…
Reference in a new issue