Skip to content

Commit e82575d

Browse files
committed
fix: TT-413 validate array empty
1 parent 78ecc0c commit e82575d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,17 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
161161
this.store.dispatch(new projectActions.LoadProjects());
162162
const recentProjects$ = this.store.pipe(select(getRecentProjects));
163163
recentProjects$.subscribe((projects) => {
164-
if (projects) {
165-
this.listRecentProjects = [];
164+
this.listRecentProjects = [];
165+
if (projects?.length > 0) {
166166
projects.forEach((project) => {
167167
const projectWithSearchField = { ...project };
168168
projectWithSearchField.search_field = `${project.customer.name} - ${project.name}`;
169169
this.listRecentProjects.push(projectWithSearchField);
170170
});
171-
this.listProjectsShowed = this.listRecentProjects;
172171
}else{
173172
this.listRecentProjects = this.listProjects;
174173
}
174+
this.listProjectsShowed = this.listRecentProjects;
175175
});
176176
}
177177

src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
7171
this.store.dispatch(new actions.LoadProjects());
7272
const recentProjects$ = this.store.pipe(select(getRecentProjects));
7373
this.recentProjectsSubscription = recentProjects$.subscribe((projects) => {
74-
if (projects) {
74+
if (projects?.length > 0) {
7575
this.listRecentProjects = projects;
7676
}else{
7777
this.listRecentProjects = this.listProjects;

0 commit comments

Comments
 (0)