Skip to content

A local-first personal finance app

Fix preview transactions not showing on all accounts page and aggregated accounts page (budgeted/offbudget) (#3873)

Joel Jeremy Marquez19f0037256f9
diff --git a/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts b/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts
index 04b630f43d..ca1471c999 100644
--- a/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts
+++ b/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts
@@ -11,7 +11,7 @@ import { useAccounts } from './useAccounts';
import { usePayees } from './usePayees';
type UseAccountPreviewTransactionsProps = {
- accountId: AccountEntity['id'];
+ accountId?: AccountEntity['id'];
};
type UseAccountPreviewTransactionsResult = {
@@ -32,9 +32,14 @@ export function useAccountPreviewTransactions({
const payees = usePayees();
const previewTransactions = useMemo(() => {
- if (!accountId || isLoading) {
+ if (isLoading) {
return [];
}
+
+ if (!accountId) {
+ return originalPreviewTransactions;
+ }
+
return accountPreview({
accountId,
transactions: originalPreviewTransactions,
diff --git a/upcoming-release-notes/3873.md b/upcoming-release-notes/3873.md
new file mode 100644
index 0000000000..a1843db3a3
--- /dev/null
+++ b/upcoming-release-notes/3873.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [joel-jeremy]
+---
+
+Fix preview transactions not showing in all accounts and aggregated accounts (budgeted/offbudget)