This commit is contained in:
seb
2026-10-28 00:08:45 +01:00
parent fab291f68e
commit 96d0ae6742
88 changed files with 3871 additions and 5334 deletions

View File

@@ -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();
}