From c59a77a9d30d6585252c004217a4526ffc18c736 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 23 Nov 2022 21:17:35 +0000 Subject: [PATCH] fix: Fixed the load error --- src/Ombi/ClientApp/src/app/login/login.component.ts | 5 +++++ src/Ombi/ClientApp/src/app/state/sonarr/sonarr.state.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/src/app/login/login.component.ts b/src/Ombi/ClientApp/src/app/login/login.component.ts index 6e8efc00b..f2aacdae4 100644 --- a/src/Ombi/ClientApp/src/app/login/login.component.ts +++ b/src/Ombi/ClientApp/src/app/login/login.component.ts @@ -13,6 +13,7 @@ import { StatusService } from "../services"; import { StorageService } from "../shared/storage/storage-service"; import { MatSnackBar } from "@angular/material/snack-bar"; import { CustomizationFacade } from "../state/customization"; +import { SonarrFacade } from "app/state/sonarr"; @Component({ templateUrl: "./login.component.html", @@ -60,6 +61,7 @@ export class LoginComponent implements OnDestroy, OnInit { private translate: TranslateService, private plexTv: PlexTvService, private store: StorageService, + private sonarrFacade: SonarrFacade, private readonly notify: MatSnackBar ) { this.href = href; @@ -142,6 +144,7 @@ export class LoginComponent implements OnDestroy, OnInit { if (this.authService.loggedIn()) { this.ngOnDestroy(); + this.sonarrFacade.load().subscribe(); this.router.navigate(["/"]); } else { this.notify.open(this.errorBody, "OK", { @@ -218,6 +221,7 @@ export class LoginComponent implements OnDestroy, OnInit { this.oAuthWindow.close(); } this.oauthLoading = false; + this.sonarrFacade.load().subscribe(); this.router.navigate(["search"]); return; } @@ -248,6 +252,7 @@ export class LoginComponent implements OnDestroy, OnInit { if (this.authService.loggedIn()) { this.ngOnDestroy(); + this.sonarrFacade.load().subscribe(); this.router.navigate(["/"]); } else { this.notify.open(this.errorBody, "OK", { diff --git a/src/Ombi/ClientApp/src/app/state/sonarr/sonarr.state.ts b/src/Ombi/ClientApp/src/app/state/sonarr/sonarr.state.ts index e8b5e4493..4f08896f8 100644 --- a/src/Ombi/ClientApp/src/app/state/sonarr/sonarr.state.ts +++ b/src/Ombi/ClientApp/src/app/state/sonarr/sonarr.state.ts @@ -19,7 +19,7 @@ export class SonarrSettingsState { @Action(LoadSettings) public load({ setState }: StateContext): Observable { const isAdmin = this.authService.isAdmin(); - const calls = isAdmin ? [this.sonarrService.getVersion(), this.settingsService.getSonarr()] : [this.sonarrService.getVersion(), of({})]; + const calls = isAdmin ? [this.sonarrService.getVersion(), this.settingsService.getSonarr()] : [of(""), of({})]; return combineLatest(calls).pipe( tap(([version, settings]) =>