fix(console): keep current url after org switch (#7118)

Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
Miguel Cabrerizo
2024-01-08 14:00:57 +00:00
committed by GitHub
co-authored by Max Peintner
parent c5bec35b1b
commit 46175b7cff
+6 -1
View File
@@ -265,7 +265,12 @@ export class AppComponent implements OnDestroy {
}
public changedOrg(org: Org.AsObject): void {
this.router.navigate(['/org']);
// Reference: https://stackoverflow.com/a/58114797
const currentUrl = this.router.url;
this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
// We use navigateByUrl as our urls may have queryParams
this.router.navigateByUrl(currentUrl);
});
}
private setLanguage(): void {