Skip to content

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.js
index 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 about
diff --git a/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsx b/packages/desktop-client/src/components/modals/ConfirmTransactionEdit.tsx
index 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({
<Button
type="primary"
onClick={() => {
- onConfirm();
modalProps.onClose();
+ onConfirm();
}}
>
Confirm
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.js b/packages/desktop-client/src/components/transactions/TransactionsTable.js
index 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 later
if (name === 'payee' && value && value.startsWith('new:')) {
diff --git a/upcoming-release-notes/1962.md b/upcoming-release-notes/1962.md
new file mode 100644
index 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.