From f6879220cb5e1abb8d6fa755d16e7e3482979c7c Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 8 Feb 2023 09:49:15 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BF=D0=BB=D0=B0=D1=82=D0=B5=D0=B6?= =?UTF-8?q?=D0=B8=20-=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B6=D0=B0=D0=B5?= =?UTF-8?q?=D0=BC=20=D0=9A=D0=9F=20=D0=A1=D0=B5=D0=B2=D0=B5=D1=80=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D1=81=20380=20=D1=81=20=D0=B4=D0=B5=D0=B3?= =?UTF-8?q?=D1=80=D0=B5=D1=81=D1=81=D0=B8=D0=B5=D0=B9,=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D0=BC=20=D0=B2=D1=8B=D0=B1=D0=B8=D1=80=D0=B0=D0=B5?= =?UTF-8?q?=D0=BC=20=D0=B3=D0=B8=D0=B1=D0=BA=D1=83=D1=8E=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BB=D0=B0=D1=82=D0=B5=D0=B6=D0=B8=20=D0=B7=D0=B0=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D1=8F=D1=8E=D1=82=D1=81=D1=8F=20=D0=BF=D1=83=D1=81?= =?UTF-8?q?=D1=82=D1=8B=D0=BC=D0=B8=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/process/payments/reactions.ts | 44 +------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/apps/web/process/payments/reactions.ts b/apps/web/process/payments/reactions.ts index da009ca..7d736f2 100644 --- a/apps/web/process/payments/reactions.ts +++ b/apps/web/process/payments/reactions.ts @@ -339,7 +339,7 @@ export default function paymentsReactions({ store }: ReactionsContext) { }, ]; - if (!$process.has('LoadKP')) { + if (!$process.has('LoadKP') && degressionType !== 100_000_007) { $tables.payments.setValues(rows.map((row) => row.value)); } @@ -348,48 +348,6 @@ export default function paymentsReactions({ store }: ReactionsContext) { } ); - makeDisposable( - () => - reaction( - () => { - const graphType = $calculation.element('radioGraphType').getValue(); - const payments = toJS($tables.payments.values); - const degressionType = $calculation.element('selectSeasonType').getValue(); - - return { - degressionType, - graphType, - payments, - }; - }, - (nextParams, prevParams) => { - if (nextParams.graphType === 100_000_001 && nextParams.degressionType === 100_000_007) { - const changes = difference(nextParams.payments, prevParams.payments); - - if (changes === null || changes.length > 1) return; - - const [changeIndex] = changes; - const value = nextParams.payments[changeIndex]; - const payments = nextParams.payments.slice(1, -1).map((payment, i) => { - if (i <= changeIndex - 2) return payment; - - return value; - }); - - const firstPaymentPerc = $calculation.element('tbxFirstPaymentPerc').getValue(); - const lastPaymentPerc = $calculation.element('tbxLastPaymentPerc').getValue(); - - $tables.payments.setValues([firstPaymentPerc, ...payments, lastPaymentPerc]); - } - }, - { - delay: 50, - equals: comparer.structural, - } - ), - () => $process.has('LoadKP') - ); - /** * Сезонный */