Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: TT-413 validate array empty
  • Loading branch information
ararcos committed Dec 2, 2021
commit e82575d5beacee09f1ed6f3ff15002d8f0802f0d
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
this.store.dispatch(new projectActions.LoadProjects());
const recentProjects$ = this.store.pipe(select(getRecentProjects));
recentProjects$.subscribe((projects) => {
if (projects) {
this.listRecentProjects = [];
this.listRecentProjects = [];
if (projects?.length > 0) {
projects.forEach((project) => {
const projectWithSearchField = { ...project };
projectWithSearchField.search_field = `${project.customer.name} - ${project.name}`;
this.listRecentProjects.push(projectWithSearchField);
});
this.listProjectsShowed = this.listRecentProjects;
}else{
this.listRecentProjects = this.listProjects;
}
this.listProjectsShowed = this.listRecentProjects;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
this.store.dispatch(new actions.LoadProjects());
const recentProjects$ = this.store.pipe(select(getRecentProjects));
this.recentProjectsSubscription = recentProjects$.subscribe((projects) => {
if (projects) {
if (projects?.length > 0) {
this.listRecentProjects = projects;
}else{
this.listRecentProjects = this.listProjects;
Expand Down