Updated tracking in template and choose customer fixing.

This commit is contained in:
2026-09-04 08:13:26 +00:00
parent 3d86f8706f
commit 95ac73bbc4
37 changed files with 120 additions and 116 deletions
@@ -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() {