1
- import { Component , OnInit } from '@angular/core' ;
2
- import { TranslateService } from '@ngx-translate/core' ;
3
- import { Subscription } from 'rxjs/Subscription' ;
4
- import { Event } from '../../../model/event.model' ;
5
- import { PipelineStatus } from '../../../model/pipeline.model' ;
6
- import { ProjectFilter , TimelineFilter } from '../../../model/timeline.model' ;
7
- import { TimelineStore } from '../../../service/timeline/timeline.store' ;
8
- import { AutoUnsubscribe } from '../../../shared/decorator/autoUnsubscribe'<
6D40
/span>;
9
- import { ToastService } from '../../../shared/toast/ToastService' ;
1
+ import { Component , OnInit } from '@angular/core' ;
2
+ import { TranslateService } from '@ngx-translate/core' ;
3
+ import { AppService } from 'app/app.service' ;
4
+ import { AuthentificationStore } from 'app/service/services.module' ;
5
+ import { Subscription } from 'rxjs/Subscription' ;
6
+ import { Event } from '../../../model/event.model' ;
7
+ import { PipelineStatus } from '../../../model/pipeline.model' ;
8
+ import { ProjectFilter , TimelineFilter } from '../../../model/timeline.model' ;
9
+ import { TimelineStore } from '../../../service/timeline/timeline.store' ;
10
+ import { AutoUnsubscribe } from '../../../shared/decorator/autoUnsubscribe' ;
11
+ import { ToastService } from '../../../shared/toast/ToastService' ;
10
12
11
13
@Component ( {
12
14
selector : 'app-home-timeline' ,
@@ -28,15 +30,23 @@ export class HomeTimelineComponent implements OnInit {
28
30
filter : TimelineFilter ;
29
31
filterSub : Subscription ;
30
32
31
- constructor ( private _timelineStore : TimelineStore , private _translate : TranslateService ,
32
- private _toast : ToastService ) {
33
+ constructor (
34
+ private _authStore : AuthentificationStore ,
35
+ private _appService : AppService ,
36
+ private _timelineStore : TimelineStore ,
37
+ private _translate : TranslateService ,
38
+ private _toast : ToastService
39
+ ) {
33
40
this . filter = new TimelineFilter ( ) ;
34
41
}
35
42
36
43
ngOnInit ( ) : void {
44
+ if ( ! this . _authStore . isConnected ) {
45
+ return ;
46
+ }
37
47
this . filterSub = this . _timelineStore . getFilter ( ) . subscribe ( f => {
38
48
this . filter = f ;
39
-
49
+ this . _appService . initFilter ( this . filter ) ;
40
50
if ( this . timelineSub ) {
41
51
this . timelineSub . unsubscribe ( ) ;
42
52
}
0 commit comments