Skip to content

A local-first personal finance app

:bug: (bank-sync) fix account highlight dissapearing (#2898)

Matiss Janis Aboltins866b4d6cd40e
diff --git a/packages/loot-core/src/client/reducers/queries.ts b/packages/loot-core/src/client/reducers/queries.ts
index b0c38817a2..84528cc12b 100644
--- a/packages/loot-core/src/client/reducers/queries.ts
+++ b/packages/loot-core/src/client/reducers/queries.ts
@@ -29,9 +29,15 @@ export function update(state = initialState, action: Action): QueriesState {
case constants.SET_NEW_TRANSACTIONS:
return {
...state,
- newTransactions: action.newTransactions || [],
- matchedTransactions: action.matchedTransactions || [],
- updatedAccounts: action.updatedAccounts || [],
+ newTransactions: action.newTransactions
+ ? [...state.newTransactions, ...action.newTransactions]
+ : state.newTransactions,
+ matchedTransactions: action.matchedTransactions
+ ? [...state.matchedTransactions, ...action.matchedTransactions]
+ : state.matchedTransactions,
+ updatedAccounts: action.updatedAccounts
+ ? [...state.updatedAccounts, ...action.updatedAccounts]
+ : state.updatedAccounts,
};
case constants.UPDATE_NEW_TRANSACTIONS:
return {
diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts
index 3c1be8ef49..44738736f8 100644
--- a/packages/loot-core/src/server/main.ts
+++ b/packages/loot-core/src/server/main.ts
@@ -1075,7 +1075,6 @@ handlers['accounts-bank-sync'] = async function ({ id }) {
acct.account_id,
acct.bankId,
);
- console.groupEnd();
const { added, updated } = res;
@@ -1113,6 +1112,8 @@ handlers['accounts-bank-sync'] = async function ({ id }) {
captureException(err);
}
+ } finally {
+ console.groupEnd();
}
}
}
diff --git a/upcoming-release-notes/2898.md b/upcoming-release-notes/2898.md
new file mode 100644
index 0000000000..fc60b25516
--- /dev/null
+++ b/upcoming-release-notes/2898.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+Bank sync: fix account with new transactions highlight disappearing if multiple consecutive accounts are synced.