Skip to content

Commit

Permalink
Let removeRepository accept a repository to remove
Browse files Browse the repository at this point in the history
  • Loading branch information
niik committed May 16, 2017
1 parent e5becdb commit 268f20c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/src/ui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class App extends React.Component<IAppProps, IAppState> {
case 'add-local-repository': return this.showAddLocalRepo()
case 'create-branch': return this.showCreateBranch()
case 'show-branches': return this.showBranches()
case 'remove-repository': return this.removeRepository()
case 'remove-repository': return this.removeRepository(this.getRepository())
case 'create-repository': return this.showCreateRepository()
case 'rename-branch': return this.renameBranch()
case 'delete-branch': return this.deleteBranch()
Expand Down Expand Up @@ -453,10 +453,14 @@ export class App extends React.Component<IAppProps, IAppState> {
this.addRepositories(paths)
}

private removeRepository() {
const repository = this.getRepository()
private removeRepository(repository: Repository | CloningRepository | null) {

if (!repository || repository instanceof CloningRepository) {
if (!repository) {
return
}

if (repository instanceof CloningRepository) {
this.props.dispatcher.removeRepositories([ repository ])
return
}

Expand Down

0 comments on commit 268f20c

Please sign in to comment.