Skip to content

Commit

Permalink
add check for change in newRepoString (#198)
Browse files Browse the repository at this point in the history
Add a check if newRepo string is different from the currentRepo string

Previously, the phaseService would always be called to change the
repository if the newRepoString is a valid repo.

Let's first check if the newRepoString is different from the currentRepo
before calling the phaseService to changeRepository.
  • Loading branch information
LJXSean authored Sep 10, 2023
1 parent ffcecb0 commit 7e34f4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/shared/layout/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ export class HeaderComponent implements OnInit {
* Change repository viewed on Issue Dashboard, if a valid repository is provided.
*/
changeRepositoryIfValid(repo: Repo, newRepoString: string) {
if (newRepoString === this.currentRepo) {
return;
}
this.phaseService
.changeRepositoryIfValid(repo)
.then(() => {
Expand Down

0 comments on commit 7e34f4e

Please sign in to comment.