I'm facing a challenging problem that I can't seem to resolve:
onSelectCompany() {
combineLatest([this.idCompany$, this.idUser$, this.router.events]).subscribe(res => {
if(res[2] instanceOf NavigationEnd){
this.router.navigateByUrl(`get-info/${res[0]/res[1]`)
}
})
}
Initially, I call this function within the ngOnInit of my component. I have two observables that serve as parameters for my URL, and I only want to navigate to this URL if the page has not been refreshed. However, the function doesn't work as expected - there are no errors, but upon debugging, it seems that the execution does not enter the subscription block. Why could this be happening?