diff --git a/moneymgr_web/src/routes/AccountRoute.tsx b/moneymgr_web/src/routes/AccountRoute.tsx index dfc638b..dd80789 100644 --- a/moneymgr_web/src/routes/AccountRoute.tsx +++ b/moneymgr_web/src/routes/AccountRoute.tsx @@ -130,7 +130,7 @@ function MovementsTable(p: { }, [p.movements, labelFilter]); const [rowSelectionModel, setRowSelectionModel] = - React.useState([]); + React.useState({ 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: { /> - { p.needReload(false); }}> + { + p.needReload(false); + }} + > @@ -411,8 +415,8 @@ function MovementsTable(p: { diff --git a/moneymgr_web/src/routes/InboxRoute.tsx b/moneymgr_web/src/routes/InboxRoute.tsx index ab15136..84ffee9 100644 --- a/moneymgr_web/src/routes/InboxRoute.tsx +++ b/moneymgr_web/src/routes/InboxRoute.tsx @@ -133,7 +133,7 @@ function InboxTable(p: { }, [p.entries, labelFilter]); const [rowSelectionModel, setRowSelectionModel] = - React.useState([]); + React.useState({ type: "include", ids: new Set() }); const [attaching, setAttaching] = React.useState(); @@ -244,7 +244,7 @@ function InboxTable(p: { // Find the entry to map const entries = p.entries.filter( - (m) => rowSelectionModel.includes(m.id) && !m.movement_id + (m) => rowSelectionModel.ids.has(m.id) && !m.movement_id ); const movements: Movement[][] = []; @@ -324,7 +324,7 @@ function InboxTable(p: { const deleteMultiple = async () => { try { const deletedEntries = p.entries.filter((m) => - rowSelectionModel.includes(m.id) + rowSelectionModel.ids.has(m.id) ); if ( @@ -437,7 +437,9 @@ function InboxTable(p: { icon={} label="Attach entry to movement" color="inherit" - onClick={() => { handleAttachClick(params.row); }} + onClick={() => { + handleAttachClick(params.row); + }} disabled={!!params.row.movement_id} /> , @@ -496,7 +498,7 @@ function InboxTable(p: { @@ -505,8 +507,8 @@ function InboxTable(p: {