check cookie before getting data
This commit is contained in:
parent
005af5a9e6
commit
c9a98b059a
1 changed files with 7 additions and 24 deletions
|
|
@ -1,12 +1,9 @@
|
|||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
OnDestroy
|
||||
Component
|
||||
} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {UserService, Session} from "@webbpm/base-package";
|
||||
import {Observable, Subscription} from "rxjs";
|
||||
import {ErvuDataService} from "../service/ervu-data.service";
|
||||
import {CookieService} from "ngx-cookie";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
|
|
@ -14,25 +11,11 @@ import {ErvuDataService} from "../service/ervu-data.service";
|
|||
templateUrl: "../../../../../src/resources/template/app/component/app_header.html",
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class AppHeaderComponent implements OnDestroy{
|
||||
export class AppHeaderComponent {
|
||||
|
||||
public currentSession: Observable<Session>;
|
||||
public subscription: Subscription;
|
||||
|
||||
constructor(protected userService: UserService, protected router: Router,
|
||||
protected ervuDataService: ErvuDataService) {
|
||||
// this.currentSession = this.userService.getCurrentSession();
|
||||
// this.subscription = this.currentSession.subscribe(session => {
|
||||
// if (session) {
|
||||
// this.ervuDataService.getData();
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
//TODO
|
||||
this.ervuDataService.getData();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.subscription.unsubscribe();
|
||||
constructor(protected cookieService: CookieService, protected ervuDataService: ErvuDataService) {
|
||||
if (cookieService.get("webbpm.ervu-lkrp-fl")) {
|
||||
this.ervuDataService.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue