From d5b438609f81bdd514673cd488658394da8c5473 Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 15 Dec 2020 14:33:43 +0300 Subject: [PATCH] fix technicalCard null while loading kp --- .../Effects/reactions/otherReactions.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts index a02ee51..6465aca 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts @@ -1795,22 +1795,29 @@ const reactionEffects: IReactionEffect[] = [ }, }), - calculationStore => ({ + (calculationStore, calculationProcess) => ({ expression: () => { const { leaseObjectType } = calculationStore.values; return { leaseObjectType }; }, effect: () => { + if (calculationProcess.process !== Process.Default) { + return; + } calculationStore.setValue('technicalCard', null); }, }), - calculationStore => ({ + (calculationStore, calculationProcess) => ({ expression: () => { const { leasingPeriod } = calculationStore.values; return leasingPeriod; }, effect: () => { + if (calculationProcess.process !== Process.Default) { + return; + } + const { technicalCard: technicalCardId } = calculationStore.values; const technicalCard = calculationStore.options.selectTechnicalCard?.find(