From 7e34f4e939e296ac0668a7683b28fea30d27b94e Mon Sep 17 00:00:00 2001 From: Sean <110801974+LJXSean@users.noreply.github.com> Date: Sun, 10 Sep 2023 15:46:56 +0800 Subject: [PATCH] add check for change in newRepoString (#198) 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. --- src/app/shared/layout/header.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/shared/layout/header.component.ts b/src/app/shared/layout/header.component.ts index 125e9cc4e..5755e3810 100644 --- a/src/app/shared/layout/header.component.ts +++ b/src/app/shared/layout/header.component.ts @@ -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(() => {