diff --git a/src/client/stores/CalculationStore/Effects/reaction.ts b/src/client/stores/CalculationStore/Effects/reaction.ts index 5f390c8..ff09f96 100644 --- a/src/client/stores/CalculationStore/Effects/reaction.ts +++ b/src/client/stores/CalculationStore/Effects/reaction.ts @@ -474,6 +474,38 @@ const reactionEffects: IReactionEffect[] = [ }, }), + calculationStore => ({ + expression: () => { + const { calcDoubleAgentRewardCondition } = calculationStore.values; + return calcDoubleAgentRewardCondition; + }, + effect: calcDoubleAgentRewardConditionId => { + if (!calcDoubleAgentRewardConditionId) { + calculationStore.setValue('calcDoubleAgentRewardSumm', null); + calculationStore.setStatus( + 'tbxCalcDoubleAgentRewardSumm', + Status.Disabled, + ); + } else { + const calcDoubleAgentRewardCondition = calculationStore.options.selectCalcDoubleAgentRewardCondition?.find( + x => x.evo_reward_conditionid === calcDoubleAgentRewardConditionId, + ); + if (calcDoubleAgentRewardCondition) { + if (calcDoubleAgentRewardCondition.evo_reward_summ) { + calculationStore.setValue( + 'calcDoubleAgentRewardSumm', + calcDoubleAgentRewardCondition.evo_reward_summ, + ); + calculationStore.setStatus( + 'tbxCalcDoubleAgentRewardSumm', + Status.Default, + ); + } + } + } + }, + }), + calculationStore => ({ expression: () => { const { channel } = calculationStore.values;