Skip to content

Commit 65ea62e

Browse files
fix: TT-106 Resolve Conflicts
2 parents be5107d + 7f9215d commit 65ea62e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/app/modules/time-clock/pages/time-clock.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
22
import { ActionsSubject, select, Store } from '@ngrx/store';
33
import { ToastrService } from 'ngx-toastr';
44
import { Subscription } from 'rxjs';
5+
56
import { filter, map } from 'rxjs/operators';
67
import { threadId } from 'worker_threads';
78
import { AzureAdB2CService } from '../../login/services/azure.ad.b2c.service';
@@ -28,10 +29,12 @@ export class TimeClockComponent implements OnInit, OnDestroy {
2829
* subscription variables
2930
*/
3031
storeSubscribe : Subscription;
32+
3133
storeSubject;
3234
exponentialGrowth;
3335

3436

37+
3538
constructor(
3639
private featureManagerService: FeatureManagerService,
3740
private azureAdB2CService: AzureAdB2CService,
@@ -45,6 +48,7 @@ export class TimeClockComponent implements OnInit, OnDestroy {
4548
// this.storeSubscribe.unsubscribe();
4649
// }
4750
this.clockOutSubscription.unsubscribe();
51+
this.storeSubscribe.unsubscribe();
4852
}
4953

5054
ngOnInit() {
@@ -56,7 +60,8 @@ export class TimeClockComponent implements OnInit, OnDestroy {
5660
// console.log('Time-clock', this.exponentialGrowth);
5761

5862
this.username = this.azureAdB2CService.isLogin() ? this.azureAdB2CService.getName() : '';
59-
this.storeSubject = this.store.pipe(select(getActiveTimeEntry)).subscribe((activeTimeEntry) => {
63+
64+
this.storeSubscribe = this.store.pipe(select(getActiveTimeEntry)).subscribe((activeTimeEntry) => {
6065
this.activeTimeEntry = activeTimeEntry;
6166
if (this.activeTimeEntry) {
6267
this.areFieldsVisible = true;

0 commit comments

Comments
 (0)