Fix mui-grid issue after update

This commit is contained in:
2025-05-15 21:51:12 +02:00
parent fb46626cff
commit 3c5c82371a
2 changed files with 21 additions and 15 deletions
moneymgr_web/src/routes

@ -130,7 +130,7 @@ function MovementsTable(p: {
}, [p.movements, labelFilter]);
const [rowSelectionModel, setRowSelectionModel] =
React.useState<GridRowSelectionModel>([]);
React.useState<GridRowSelectionModel>({ type: "include", ids: new Set() });
// Set uploaded file
const setUploadedFile = async (
@ -216,7 +216,7 @@ function MovementsTable(p: {
const moveMultiple = async () => {
try {
const movements = p.movements.filter((m) =>
rowSelectionModel.includes(m.id)
rowSelectionModel.ids.has(m.id)
);
const targetAccount = await chooseAccount(
@ -260,7 +260,7 @@ function MovementsTable(p: {
const deleteMultiple = async () => {
try {
const movements = p.movements.filter((m) =>
rowSelectionModel.includes(m.id)
rowSelectionModel.ids.has(m.id)
);
if (
@ -393,15 +393,19 @@ function MovementsTable(p: {
/>
<span style={{ flex: 1 }}></span>
<Tooltip title="Refresh table">
<IconButton onClick={() => { p.needReload(false); }}>
<IconButton
onClick={() => {
p.needReload(false);
}}
>
<RefreshIcon />
</IconButton>
</Tooltip>
<Tooltip title="Move all the selected entries to another account">
<IconButton
disabled={
rowSelectionModel.length === 0 ||
rowSelectionModel.length === p.movements.length
rowSelectionModel.ids.size === 0 ||
rowSelectionModel.ids.size === p.movements.length
}
onClick={moveMultiple}
>
@ -411,8 +415,8 @@ function MovementsTable(p: {
<Tooltip title="Delete all the selected entries">
<IconButton
disabled={
rowSelectionModel.length === 0 ||
rowSelectionModel.length === p.movements.length
rowSelectionModel.ids.size === 0 ||
rowSelectionModel.ids.size === p.movements.length
}
onClick={deleteMultiple}
>