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);