diff --git a/packages/ui-core/shared/src/lib/employee/employee-multi-select/employee-multi-select.component.ts b/packages/ui-core/shared/src/lib/employee/employee-multi-select/employee-multi-select.component.ts index 7c148246150..6d5bf956008 100644 --- a/packages/ui-core/shared/src/lib/employee/employee-multi-select/employee-multi-select.component.ts +++ b/packages/ui-core/shared/src/lib/employee/employee-multi-select/employee-multi-select.component.ts @@ -98,13 +98,7 @@ export class EmployeeSelectComponent implements OnInit, OnDestroy { public organization: IOrganization = this.store.selectedOrganization; public selectedDateRange: IDateRangePicker; - ngOnInit(): void { - //delay to pre selected employee - this.loaded = false; - setTimeout(() => { - this.loaded = true; - }, 500); - + async ngOnInit(): Promise { this.changeValue$.pipe(debounceTime(100), untilDestroyed(this)).subscribe((value) => { this.checkForMultiSelectValue(value); this.onChange(this.val); @@ -122,10 +116,13 @@ export class EmployeeSelectComponent implements OnInit, OnDestroy { tap(([dateRange]) => { this.selectedDateRange = dateRange; }), - tap(() => { + tap(async () => { if (!this.allEmployees || this.allEmployees.length === 0) { - this.getWorkingEmployees(); + await this.getWorkingEmployees(); } + + this.select.setValue(this.preSelected); + this.loaded = true; }), untilDestroyed(this) )