mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-24 06:55:23 -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 { StorageService } from "../shared/storage/storage-service";
|
||||||
import { MatSnackBar } from "@angular/material/snack-bar";
|
import { MatSnackBar } from "@angular/material/snack-bar";
|
||||||
import { CustomizationFacade } from "../state/customization";
|
import { CustomizationFacade } from "../state/customization";
|
||||||
|
import { SonarrFacade } from "app/state/sonarr";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./login.component.html",
|
templateUrl: "./login.component.html",
|
||||||
|
@ -60,6 +61,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private plexTv: PlexTvService,
|
private plexTv: PlexTvService,
|
||||||
private store: StorageService,
|
private store: StorageService,
|
||||||
|
private sonarrFacade: SonarrFacade,
|
||||||
private readonly notify: MatSnackBar
|
private readonly notify: MatSnackBar
|
||||||
) {
|
) {
|
||||||
this.href = href;
|
this.href = href;
|
||||||
|
@ -142,6 +144,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
|
|
||||||
if (this.authService.loggedIn()) {
|
if (this.authService.loggedIn()) {
|
||||||
this.ngOnDestroy();
|
this.ngOnDestroy();
|
||||||
|
this.sonarrFacade.load().subscribe();
|
||||||
this.router.navigate(["/"]);
|
this.router.navigate(["/"]);
|
||||||
} else {
|
} else {
|
||||||
this.notify.open(this.errorBody, "OK", {
|
this.notify.open(this.errorBody, "OK", {
|
||||||
|
@ -218,6 +221,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
this.oAuthWindow.close();
|
this.oAuthWindow.close();
|
||||||
}
|
}
|
||||||
this.oauthLoading = false;
|
this.oauthLoading = false;
|
||||||
|
this.sonarrFacade.load().subscribe();
|
||||||
this.router.navigate(["search"]);
|
this.router.navigate(["search"]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -248,6 +252,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
|
|
||||||
if (this.authService.loggedIn()) {
|
if (this.authService.loggedIn()) {
|
||||||
this.ngOnDestroy();
|
this.ngOnDestroy();
|
||||||
|
this.sonarrFacade.load().subscribe();
|
||||||
this.router.navigate(["/"]);
|
this.router.navigate(["/"]);
|
||||||
} else {
|
} else {
|
||||||
this.notify.open(this.errorBody, "OK", {
|
this.notify.open(this.errorBody, "OK", {
|
||||||
|
|
|
@ -19,7 +19,7 @@ export class SonarrSettingsState {
|
||||||
@Action(LoadSettings)
|
@Action(LoadSettings)
|
||||||
public load({ setState }: StateContext<SonarrState>): Observable<SonarrState> {
|
public load({ setState }: StateContext<SonarrState>): Observable<SonarrState> {
|
||||||
const isAdmin = this.authService.isAdmin();
|
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(
|
return combineLatest(calls).pipe(
|
||||||
tap(([version, settings]) =>
|
tap(([version, settings]) =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue