diff --git a/stores/tables/payments/index.ts b/stores/tables/payments/index.ts index 51c7edd..b7b1528 100644 --- a/stores/tables/payments/index.ts +++ b/stores/tables/payments/index.ts @@ -1,6 +1,6 @@ import type { Status } from 'Elements/types'; import type { IObservableArray } from 'mobx'; -import { makeAutoObservable, observable } from 'mobx'; +import { makeAutoObservable, observable, reaction } from 'mobx'; import type RootStore from 'stores/root'; import Validation from '../validation'; @@ -21,6 +21,16 @@ export default class PaymentsTable { this.values = observable([]); this.statuses = observable([]); makeAutoObservable(this); + + /** + * Синхронизируем длину массива значений и статусов + */ + reaction( + () => this.values.length, + (length) => { + this.statuses.length = length; + } + ); } getValue(index: number) {