A local-first personal finance app
[Bugfix] Fixed modal error and transactions now unlock when moved across accounts. (#1962)
Zach Whelchele7f298e32aa1
diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.jsindex d7e8b4d228..8e047c7abb 100644--- a/packages/desktop-client/src/components/accounts/Account.js+++ b/packages/desktop-client/src/components/accounts/Account.js@@ -826,10 +826,16 @@ class AccountInternal extends PureComponent {return;}- let { diff } = updateTransaction(transactions, {+ let transaction = {...trans,[name]: value,- });+ };++ if (name === 'account' && trans.account !== value) {+ transaction.reconciled = false;+ }++ let { diff } = updateTransaction(transactions, transaction);// TODO: We need to keep an updated list of transactions so// the logic in `updateTransaction`, particularly aboutdiff --git a/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsx b/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsxindex 837872dd9b..a15de63e2a 100644--- a/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsx+++ b/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsx@@ -70,8 +70,8 @@ function ConfirmTransactionEdit({<Buttontype="primary"onClick={() => {- onConfirm();modalProps.onClose();+ onConfirm();}}>Confirmdiff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.js b/packages/desktop-client/src/components/transactions/TransactionsTable.jsindex f70a1db043..c0288def8a 100644--- a/packages/desktop-client/src/components/transactions/TransactionsTable.js+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.js@@ -796,6 +796,10 @@ const Transaction = memo(function Transaction(props) {newTransaction['credit'] = '';}+ if (name === 'account' && transaction.account !== value) {+ newTransaction.reconciled = false;+ }+// Don't save a temporary value (a new payee) which will be// filled in with a real id laterif (name === 'payee' && value && value.startsWith('new:')) {diff --git a/upcoming-release-notes/1962.md b/upcoming-release-notes/1962.mdnew file mode 100644index 0000000000..e47720db0a--- /dev/null+++ b/upcoming-release-notes/1962.md@@ -0,0 +1,6 @@+---+category: Bugfix+authors: [zachwhelchel]+---++Fix broken modals. Unlock transactions moved to another account.