Updated tracking in template and choose customer fixing.
This commit is contained in:
@@ -66,11 +66,15 @@ export class ChooseCustomerComponent {
|
||||
return typeof p === 'string' ? p.trim() : null;
|
||||
});
|
||||
|
||||
debouncedPhone = debounced(this.phoneSignal, 150);
|
||||
debouncedPhone = debounced(this.phoneSignal, 300);
|
||||
|
||||
customersResource = this.ser.autocomplete(this.debouncedPhone.value);
|
||||
customers = computed(() => {
|
||||
return this.customersResource.value() ?? [];
|
||||
customers = linkedSignal<Customer[] | undefined, Customer[]>({
|
||||
source: () => this.customersResource.value(),
|
||||
computation: (newVal, previous) => {
|
||||
if (!this.debouncedPhone.value()) return [];
|
||||
return newVal ?? previous?.value ?? [];
|
||||
},
|
||||
});
|
||||
|
||||
save() {
|
||||
|
||||
Reference in New Issue
Block a user