u
This commit is contained in:
@@ -17,7 +17,7 @@ import FillSpace from 'dashgui/FillSpace';
|
||||
import { PanelTile, PanelTileGrid } from 'dashgui/panels';
|
||||
import BackendError from '../BackendError';
|
||||
import orderAutomat from '../../automats/orderAutomat';
|
||||
import accountAutomat from '../../automats/accountAutomat';
|
||||
import companyAutomat from '../../automats/companyAutomat';
|
||||
import { payment as paymentApi } from '../../api';
|
||||
import { backendErrorFrom } from '../../utils/backendError';
|
||||
import { notifyError } from '../../utils/notify';
|
||||
@@ -184,14 +184,18 @@ export class OrderPaymentList extends PureComponent {
|
||||
status: state.status,
|
||||
error: state.error ? backendErrorFrom(state.error) : null,
|
||||
}));
|
||||
this.unsubAccount = accountAutomat.subscribe(this, (state) => ({
|
||||
accountsById: Object.fromEntries((state.items || []).map((a) => [a.id, a.name])),
|
||||
}));
|
||||
this.unsubAccount = companyAutomat.subscribe(
|
||||
this,
|
||||
(state) => ({
|
||||
accountsById: Object.fromEntries((state.accounts || []).map((a) => [a.id, a.name])),
|
||||
}),
|
||||
['accounts'],
|
||||
);
|
||||
|
||||
if (orderAutomat.state.status === 'idle') {
|
||||
void orderAutomat.actions.load().catch(() => {});
|
||||
}
|
||||
void accountAutomat.actions.ensureLoaded().catch(() => {});
|
||||
void companyAutomat.actions.ensureAccountsLoaded().catch(() => {});
|
||||
void this.loadPartiesData();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user