Skip to content

Commit a71577b

Browse files
refactor: TTL-910 modify ngOnChange feature
1 parent 638d5d4 commit a71577b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/app/modules/reports/components/time-range-form/time-range-form.component.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,9 @@ export class TimeRangeFormComponent implements OnInit, OnChanges {
3535
this.setInitialDataOnScreen();
3636
}
3737

38-
ngOnChanges(changes: SimpleChanges){
39-
if (!changes.userId.firstChange){
40-
this.onSubmit();
41-
}
42-
if (!changes.projectId.firstChange){
43-
this.onSubmit();
44-
}
45-
if (!changes.activityId.firstChange){
38+
ngOnChanges(changes: SimpleChanges) {
39+
const firstChange = Object.values(changes)[0].firstChange;
40+
if (!firstChange) {
4641
this.onSubmit();
4742
}
4843
}

0 commit comments

Comments
 (0)