@@ -40,7 +40,8 @@ export class EntryFieldsComponent implements OnInit, OnDestroy {
4040 loadActivitiesSubject ;
4141 loadActiveEntrySubject ;
4242 actionSetDateSubject ;
43- exponentialGrowth : Boolean ;
43+
44+ exponentialGrowth ;
4445
4546 constructor (
4647 private featureManagerService : FeatureManagerService ,
@@ -58,12 +59,14 @@ export class EntryFieldsComponent implements OnInit, OnDestroy {
5859 } ) ;
5960 }
6061
62+
6163 async ngOnInit ( ) : Promise < void > {
6264
6365 this . exponentialGrowth = await this . isFeatureToggleActivated ( ) ;
6466
6567 console . log ( this . exponentialGrowth ) ;
6668
69+
6770 this . store . dispatch ( new LoadActivities ( ) ) ;
6871 this . store . dispatch ( new entryActions . LoadEntries ( new Date ( ) . getMonth ( ) + 1 , new Date ( ) . getFullYear ( ) ) ) ;
6972 this . loadActivitiesSubject = this . actionsSubject$
@@ -73,8 +76,10 @@ export class EntryFieldsComponent implements OnInit, OnDestroy {
7376 this . store . dispatch ( new LoadActiveEntry ( ) ) ;
7477 } ) ;
7578
79+
7680 this . exponentialGrowth ? this . loadActivitiesSubscribe = this . loadActivitiesSubject : this . loadActivitiesSubject ;
7781
82+
7883 this . loadActiveEntrySubject = this . actionsSubject$
7984 . pipe (
8085 filter (
@@ -94,8 +99,10 @@ export class EntryFieldsComponent implements OnInit, OnDestroy {
9499 }
95100 } ) ;
96101
102+
97103 this . exponentialGrowth ? this . loadActiveEntrySubscribe = this . loadActiveEntrySubject : this . loadActiveEntrySubject ;
98104
105+
99106 this . actionSetDateSubject = this . actionsSubject$
100107 . pipe ( filter ( ( action : any ) => action . type === EntryActionTypes . LOAD_ACTIVE_ENTRY_SUCCESS ) )
101108 . subscribe ( ( action ) => {
@@ -111,7 +118,8 @@ export class EntryFieldsComponent implements OnInit, OnDestroy {
111118 } ;
112119 } ) ;
113120
114- this . exponentialGrowth ? this . actionSetDateSubscribe = this . actionSetDateSubject : this . actionSetDateSubject ;
121+ this . exponentialGrowth ? this . actionSetDateSubscribe = this . actionSetDateSubject : this . actionSetDateSubject ;
122+
115123 }
116124
117125 get activity_id ( ) {
@@ -198,12 +206,13 @@ export class EntryFieldsComponent implements OnInit, OnDestroy {
198206
199207
200208 ngOnDestroy ( ) : void {
201- console . log ( this . exponentialGrowth ) ;
209+
202210 if ( this . exponentialGrowth ) {
203211 this . loadActivitiesSubscribe . unsubscribe ( ) ;
204212 this . loadActiveEntrySubscribe . unsubscribe ( ) ;
205213 this . actionSetDateSubscribe . unsubscribe ( ) ;
206214 }
215+
207216 console . log ( 'Entry Fields OnDestroy' ) ;
208217 }
209218
0 commit comments