From c3c93d310934f28189f8633bed3f00e96e68af19 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 10 Dec 2020 17:29:24 +0300 Subject: [PATCH] fix: disable load quote if quoteid is null --- .../Effects/reactions/loadKpReaction/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts index de83eb7..fb119b4 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts @@ -45,7 +45,10 @@ const loadKpReaction: IReactionEffect = calculationStore => ({ return quote; }, effect: quoteId => { - const { lead, quote, opportunity } = calculationStore.values; + if (!quoteId) { + return; + } + const { lead, opportunity } = calculationStore.values; calculationStore.setStatus('selectQuote', ElementStatus.Disabled); calculationStore.setStatus('btnCalculate', ElementStatus.Disabled); @@ -229,7 +232,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({ content: `КП ${quote?.evo_quotename || ''} загружено!`, }); } - }) + }) .finally(() => { calculationStore.setStatus('selectQuote', ElementStatus.Default); calculationStore.setStatus('btnCalculate', ElementStatus.Default);