From 2005ada76139577f2ba1b43b2e5ba70b6168b522 Mon Sep 17 00:00:00 2001 From: Charles Taylor <taylorc822@gmail.com> Date: Thu, 3 Nov 2022 22:12:08 +1100 Subject: [PATCH] feat: ensure only selected transactions are modified --- .../desktop-client/src/components/accounts/Account.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js index 148614236..9264f221c 100644 --- a/packages/desktop-client/src/components/accounts/Account.js +++ b/packages/desktop-client/src/components/accounts/Account.js @@ -1413,7 +1413,15 @@ class AccountInternal extends React.PureComponent { value = !!transactions.find(t => !t.cleared); } + let idSet = new Set(ids); + transactions.forEach(trans => { + if (!idSet.has(trans.id)) { + // Skip transactions which aren't actually selected, since the + // query above also retrieves the siblings of any selected splits. + return; + } + let { diff } = updateTransaction(transactions, { ...trans, [name]: value -- GitLab