From c6f0474f66670c85dcd60d703e757cb6b00ccc3b Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 13 Aug 2024 15:25:28 +0300 Subject: [PATCH] enable init elt on load-kp --- apps/web/process/elt/reactions/common.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/process/elt/reactions/common.ts b/apps/web/process/elt/reactions/common.ts index 100fed4..523589a 100644 --- a/apps/web/process/elt/reactions/common.ts +++ b/apps/web/process/elt/reactions/common.ts @@ -1,6 +1,6 @@ import type { ProcessContext } from '../../types'; import helper from '../lib/helper'; -import { disposableReaction } from '@/utils/mobx'; +import { disposableDebouncedReaction, disposableReaction } from '@/utils/mobx'; import { comparer, toJS } from 'mobx'; export default function reactions(context: ProcessContext) { @@ -9,8 +9,8 @@ export default function reactions(context: ProcessContext) { const { init } = helper(context); - disposableReaction( - () => $process.has('ELT') || $process.has('LoadKP'), + disposableDebouncedReaction( + () => $process.has('ELT'), () => ({ values: $calculation.$values.getValues([ 'objectRegistration', @@ -55,11 +55,12 @@ export default function reactions(context: ProcessContext) { delay: 10, equals: comparer.shallow, fireImmediately: true, + wait: 100, } ); - disposableReaction( - () => $process.has('ELT') || $process.has('LoadKP'), + disposableDebouncedReaction( + () => $process.has('ELT'), () => ({ values: $calculation.$values.getValues([ 'legalClientRegion', @@ -111,6 +112,7 @@ export default function reactions(context: ProcessContext) { delay: 10, equals: comparer.shallow, fireImmediately: true, + wait: 100, } );