|
@@ -1,19 +1,26 @@
|
|
|
|
+import { UpdateOperation } from './operations/update.operations';
|
|
import { Router } from '@angular/router';
|
|
import { Router } from '@angular/router';
|
|
-import { Component } from '@angular/core';
|
|
|
|
|
|
+import { Component, OnInit } from '@angular/core';
|
|
import { StateService } from './services/state.service';
|
|
import { StateService } from './services/state.service';
|
|
import { SessionOperation } from './operations/session.operation';
|
|
import { SessionOperation } from './operations/session.operation';
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
- selector: 'app-root',
|
|
|
|
- templateUrl: './app.component.html',
|
|
|
|
- styleUrls: ['./app.component.scss']
|
|
|
|
|
|
+ selector: 'app-root',
|
|
|
|
+ templateUrl: './app.component.html',
|
|
|
|
+ styleUrls: ['./app.component.scss']
|
|
})
|
|
})
|
|
-export class AppComponent {
|
|
|
|
|
|
+export class AppComponent implements OnInit {
|
|
|
|
|
|
- constructor(public gs: StateService, private session: SessionOperation, private router: Router) { }
|
|
|
|
|
|
+ constructor(public gs: StateService, private session: SessionOperation, private router: Router, private update: UpdateOperation) { }
|
|
|
|
|
|
- public async onLogout() {
|
|
|
|
- await this.session.logout();
|
|
|
|
- this.router.navigate(['/logout']);
|
|
|
|
- }
|
|
|
|
|
|
+ async ngOnInit() {
|
|
|
|
+ if (await this.update.updateRequired()) {
|
|
|
|
+ this.router.navigate(['/update']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public async onLogout() {
|
|
|
|
+ await this.session.logout();
|
|
|
|
+ this.router.navigate(['/logout']);
|
|
|
|
+ }
|
|
}
|
|
}
|