У меня такая ситуация:
this._userService
.create(user)
.pipe(
switchMap(res => {
if (this.accountStore.accounts.length > 0) {
return this._accountsService.manageAccounts(
accounts,
res.idUser
);
} else return of();
})
)
.subscribe(
_ => {
this._router.navigate(["/app/main/user/"]);
},
() => (this.saving = false)
);
, если учетные записи выше 0, все работает нормально.Но если он переходит к блоку else, return of()
не выполняет next () для перехода к маршруту пользователя;
Что я делаю не так?