mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-22 06:13:22 -07:00
fix: Fixed the load error
This commit is contained in:
parent
b86cf92ea3
commit
c59a77a9d3
2 changed files with 6 additions and 1 deletions
|
@ -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", {
|
||||
|
|
|
@ -19,7 +19,7 @@ export class SonarrSettingsState {
|
|||
@Action(LoadSettings)
|
||||
public load({ setState }: StateContext<SonarrState>): Observable<SonarrState> {
|
||||
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]) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue