From 8efe2e54b34d7726f046cce8cd4b6f6b5e538fda Mon Sep 17 00:00:00 2001 From: Nikolai Date: Thu, 10 Nov 2022 17:57:13 +0600 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BA=D0=B8=D0=B4=D0=BA=D0=B8=20-=20?= =?UTF-8?q?=D0=B1=D0=B0=D0=B3=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Content/Tariffs/DataGridElement/index.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx b/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx index 60e23e8..990349f 100644 --- a/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx +++ b/src/Components/LoggedIn/Content/Tariffs/DataGridElement/index.tsx @@ -541,12 +541,8 @@ const DataGridElement: React.FC = ({ openModal }) => { if( discountsActiveArray.length >= 0 && checkboxStates == 1 && selectedPromocode < 0 ) { discountsActiveArray.forEach( (activeDiscount) => { discountsArray.forEach( (discount, i) => { - if( item.tariffs ) { - item.tariffs.forEach( (t) => { - if( t.time ) { percents = percents + discountTime( t.time ); } - if( t.points ) { percents = percents + discountCapacity( t.time ); } - }); - } + if( tariff.time ) { percents = percents + discountTime( tariff.time ); } + if( tariff.points ) { percents = percents + discountCapacity( tariff.time ); } }); }); } @@ -555,12 +551,8 @@ const DataGridElement: React.FC = ({ openModal }) => { if( discountsActiveArray.length >= 0 && checkboxStates == 1 && selectedPromocode < 0 ) { discountsActiveArray.forEach( (activeDiscount) => { discountsArray.forEach( (discount, i) => { - if( item.tariffs ) { - item.tariffs.forEach( (t) => { - if( t.time && t.points ) { - percents = percents + discountProduct( t.time, t.points ); - } - }); + if( tariff.time && tariff.points ) { + percents = percents + discountProduct( tariff.time, tariff.points ); } }); });