process/payments: fix degression & firstPaymentPerc

This commit is contained in:
vchikalkin 2023-06-09 15:13:16 +03:00
parent 7ce8104b87
commit 0f32abc6b2

View File

@ -290,6 +290,8 @@ export default function reactions({ store }: ProcessContext) {
if (!changes?.length || changes.length > 1) return;
const [changeIndex] = changes;
if (changeIndex < 1) return;
const value = nextPayments[changeIndex];
const payments = nextPayments.slice(1, -1).map((payment, i) => {
if (i <= changeIndex - 2) return payment;