Skip to content

Commit a5fa8b5

Browse files
committed
fix: Auto code the extracted vendor if org vendor list is empty (#3218)
* add loop * refactor * replace at more places * some fixes * minor * fix unit tests * minor * add check for empty vendor list
1 parent f6bc177 commit a5fa8b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/fyle/add-edit-expense/add-edit-expense.page.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export class AddEditExpensePage implements OnInit {
439439

440440
selectedCategory$: Observable<OrgCategory>;
441441

442-
vendorOptions: string[];
442+
vendorOptions: string[] = [];
443443

444444
constructor(
445445
private activatedRoute: ActivatedRoute,
@@ -4556,6 +4556,9 @@ export class AddEditExpensePage implements OnInit {
45564556
}
45574557

45584558
private filterVendor(vendor: string): string | null {
4559+
if (!vendor || this.vendorOptions?.length === 0) {
4560+
return vendor;
4561+
}
45594562
return this.vendorOptions?.find((option) => option.toLowerCase() === vendor.toLowerCase()) || null;
45604563
}
45614564

0 commit comments

Comments
 (0)