From 66ad62beb51ffc22090a8f65defe7f68442424b4 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 29 Sep 2017 14:54:44 +0100 Subject: [PATCH] Fixed an issue where we messed up the pages and routing. Also added the requester onto the movie requests #865 #1513 --- src/Ombi/ClientApp/app/app.component.ts | 4 +++- .../ClientApp/app/login/login.component.ts | 22 ++++++++++--------- .../app/requests/movierequests.component.html | 6 +++++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Ombi/ClientApp/app/app.component.ts b/src/Ombi/ClientApp/app/app.component.ts index b8787161e..3ff460330 100644 --- a/src/Ombi/ClientApp/app/app.component.ts +++ b/src/Ombi/ClientApp/app/app.component.ts @@ -35,7 +35,9 @@ export class AppComponent implements OnInit { this.showNav = this.authService.loggedIn(); }); - this.jobService.getCachedUpdate().subscribe(x => this.updateAvailable = x); + if (this.user !== null && this.user.name) { + this.jobService.getCachedUpdate().subscribe(x => this.updateAvailable = x); + } } public hasRole(role: string): boolean { diff --git a/src/Ombi/ClientApp/app/login/login.component.ts b/src/Ombi/ClientApp/app/login/login.component.ts index c904fc4e1..1e2bcef26 100644 --- a/src/Ombi/ClientApp/app/login/login.component.ts +++ b/src/Ombi/ClientApp/app/login/login.component.ts @@ -25,6 +25,18 @@ export class LoginComponent implements OnInit { constructor(private authService: AuthService, private router: Router, private notify: NotificationService, private status: StatusService, private fb: FormBuilder, private settingsService: SettingsService, private images: ImageService, private sanitizer: DomSanitizer, private route: ActivatedRoute) { + this.route.params + .subscribe(params => { + this.landingFlag = params.landing; + if (this.landingFlag === false) { + this.settingsService.getLandingPage().subscribe(x => { + if (x.enabled && !this.landingFlag) { + this.router.navigate(["landingpage"]); + } + }); + } + }); + this.form = this.fb.group({ username: ["", [Validators.required]], password: ["", [Validators.required]], @@ -36,19 +48,9 @@ export class LoginComponent implements OnInit { this.router.navigate(["Wizard"]); } }); - - this.route.params - .subscribe(params => { - this.landingFlag = params.landing; - }); } public ngOnInit() { - this.settingsService.getLandingPage().subscribe(x => { - if (x.enabled && !this.landingFlag) { - this.router.navigate(["landingpage"]); - } - }); this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x); this.images.getRandomBackground().subscribe(x => { this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%),url(" + x.url + ")"); diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index d45a2b4c1..25f4ee1a9 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -28,6 +28,12 @@
+
+ Requested By: + {{request.requestedUser.userName}} + {{request.requestedUser.alias}} + {{request.requestedUser.userName}} +
Status: {{request.status}}