Skip to content

Commit

Permalink
feat: Do not set defaultRepositoryId when defaultRepositoryId not con…
Browse files Browse the repository at this point in the history
…tain thr repo.
  • Loading branch information
DiamondYuan committed Feb 6, 2019
1 parent d4ae5de commit 718b7b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/tool/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ class Page extends React.Component<PageProps, PageState> {
currentRepository
} = this.props;

let repositoryId = defaultRepositoryId;
let repositoryId;
if (
repositories.findIndex(
(repository: Repository) => repository.id === defaultRepositoryId
) !== -1
) {
repositoryId = defaultRepositoryId;
}
if (currentRepository) {
repositoryId = currentRepository.id;
}
Expand Down

0 comments on commit 718b7b7

Please sign in to comment.