fix(wizard): 🐛 Stop access to the wizard when you have already setup ombi (#4866)

pull/4871/head
Jamie 1 year ago committed by GitHub
parent c08805494c
commit 353de981a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,7 +24,8 @@
"details",
"requests",
"sonarr",
"plex"
"plex",
"wizard"
],
"rpc.enabled": true
}

@ -90,6 +90,8 @@ export class LoginComponent implements OnDestroy, OnInit {
if (authService.loggedIn()) {
this.loadStores();
this.router.navigate(["/"]);
}
}

@ -11,7 +11,11 @@ export class StatusService extends ServiceHelpers {
constructor(http: HttpClient, @Inject(APP_BASE_HREF) href:string) {
super(http, "/api/v1/status/", href);
}
public getWizardStatus(): Observable<any> {
return this.http.get(`${this.url}Wizard/`, {headers: this.headers});
public getWizardStatus(): Observable<WizardResult> {
return this.http.get<WizardResult>(`${this.url}Wizard/`, {headers: this.headers});
}
}
export interface WizardResult {
result: boolean;
}

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from "@angular/core";
import { IdentityService, NotificationService, SettingsService } from "../../services";
import { IdentityService, NotificationService, SettingsService, StatusService } from "../../services";
import { CustomizationFacade } from "../../state/customization/customization.facade";
import { ICreateWizardUser } from "../../interfaces";
@ -7,6 +7,7 @@ import { IOmbiConfigModel } from "../models/OmbiConfigModel";
import { MatStepper } from'@angular/material/stepper';
import { Router } from "@angular/router";
import { WizardService } from "../services/wizard.service";
import { Observable, take } from "rxjs";
@Component({
templateUrl: "./welcome.component.html",
@ -20,9 +21,16 @@ export class WelcomeComponent implements OnInit {
constructor(private router: Router, private identityService: IdentityService,
private notificationService: NotificationService, private WizardService: WizardService,
private settingsService: SettingsService, private customizationFacade: CustomizationFacade) { }
private settingsService: SettingsService, private customizationFacade: CustomizationFacade,
private status: StatusService) { }
public ngOnInit(): void {
this.status.getWizardStatus().pipe(take(1))
.subscribe(x => {
if (x.result) {
this.router.navigate(["login"]);
}
});
this.localUser = {
password:"",
username:"",

Loading…
Cancel
Save