From 52a22b3a606c3a4decd13de30f37bc1241565013 Mon Sep 17 00:00:00 2001 From: Jamie Date: Fri, 15 Dec 2017 08:46:46 +0000 Subject: [PATCH] Stop making unnecessary calls to the update service --- src/Ombi/ClientApp/app/app.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/app/app.component.ts b/src/Ombi/ClientApp/app/app.component.ts index 1c69d6c6c..f45e8f94f 100644 --- a/src/Ombi/ClientApp/app/app.component.ts +++ b/src/Ombi/ClientApp/app/app.component.ts @@ -21,6 +21,8 @@ export class AppComponent implements OnInit { public updateAvailable: boolean; public currentUrl: string; + private checkedForUpdate: boolean; + constructor(public notificationService: NotificationService, public authService: AuthService, private readonly router: Router, @@ -47,7 +49,8 @@ export class AppComponent implements OnInit { this.user = this.authService.claims(); this.showNav = this.authService.loggedIn(); - if (this.user !== null && this.user.name) { + if (this.user !== null && this.user.name && !this.checkedForUpdate) { + this.checkedForUpdate = true; this.jobService.getCachedUpdate().subscribe(x => { this.updateAvailable = x; });