From 9d53867178ecebad8c199a2af51240b05f498bb2 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 12 Apr 2023 17:34:34 +0300 Subject: [PATCH] process/insurance: fix insuranceCompany options reactions --- apps/web/process/insurance/reactions.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/web/process/insurance/reactions.ts b/apps/web/process/insurance/reactions.ts index a95f24d..2750ee0 100644 --- a/apps/web/process/insurance/reactions.ts +++ b/apps/web/process/insurance/reactions.ts @@ -115,7 +115,7 @@ export function common({ store, apolloClient }: ProcessContext) { } ); - reaction( + debouncedReaction( () => $calculation.$values.getValues(['leasingPeriod', 'leasingWithoutKasko']), async ({ leasingPeriod, leasingWithoutKasko }) => { const { @@ -170,11 +170,13 @@ export function common({ store, apolloClient }: ProcessContext) { } }, { + delay: 1, fireImmediately: true, + wait: 100, } ); - reaction( + debouncedReaction( () => $calculation.$values.getValues(['leaseObjectCategory', 'leasingWithoutKasko']), async ({ leaseObjectCategory, leasingWithoutKasko }) => { const { @@ -222,6 +224,10 @@ export function common({ store, apolloClient }: ProcessContext) { .setOptions(normalizeOptions(defaultOsagoOptions)); } } + }, + { + delay: 1, + wait: 100, } );