From 116c9cab22ba5b686862f7448fdd352afcdb0f64 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 19 Nov 2020 23:12:47 +0300 Subject: [PATCH] unlock balanceHolder --- .../CalculationStore/Effects/reaction.ts | 38 +++++++++---------- .../config/initialStatuses.ts | 2 - 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reaction.ts b/src/client/stores/CalculationStore/Effects/reaction.ts index c7089ac..11b3d92 100644 --- a/src/client/stores/CalculationStore/Effects/reaction.ts +++ b/src/client/stores/CalculationStore/Effects/reaction.ts @@ -1260,25 +1260,25 @@ const reactionEffects: IReactionEffect[] = [ }, }), - // calculationStore => ({ - // expression: () => { - // const { leasingPeriod } = calculationStore.values; - // return leasingPeriod; - // }, - // effect: leasingPeriod => { - // if (leasingPeriod) { - // if (parseInt(leasingPeriod) < 12) { - // calculationStore.setStatus('radioBalanceHolder', Status.Disabled); - // calculationStore.setValue('balanceHolder', 100000000); - // } else { - // calculationStore.setStatus('radioBalanceHolder', Status.Default); - // } - // } - // }, - // options: { - // fireImmediately: true, - // }, - // }), + calculationStore => ({ + expression: () => { + const { leasingPeriod } = calculationStore.values; + return leasingPeriod; + }, + effect: leasingPeriod => { + if (leasingPeriod) { + if (parseInt(leasingPeriod) < 12) { + calculationStore.setStatus('radioBalanceHolder', Status.Disabled); + calculationStore.setValue('balanceHolder', 100000000); + } else { + calculationStore.setStatus('radioBalanceHolder', Status.Default); + } + } + }, + options: { + fireImmediately: true, + }, + }), calculationStore => ({ expression: () => { diff --git a/src/client/stores/CalculationStore/config/initialStatuses.ts b/src/client/stores/CalculationStore/config/initialStatuses.ts index 01d39ea..69acc66 100644 --- a/src/client/stores/CalculationStore/config/initialStatuses.ts +++ b/src/client/stores/CalculationStore/config/initialStatuses.ts @@ -36,8 +36,6 @@ const initialStatuses: TElements = { selectAgent: Status.Disabled, tbxCommentLead: Status.Disabled, btnCreateLead: Status.Disabled, - - radioBalanceHolder: Status.Disabled, }; export default initialStatuses;