From 19f0037256f96bd01fd67a7d28b18b4dd2d523fb Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Thu, 21 Nov 2024 14:24:57 -0800 Subject: [PATCH] Fix preview transactions not showing on all accounts page and aggregated accounts page (budgeted/offbudget) (#3873) * Fix preview transactions not showing on all accounts * Release notes --- .../src/hooks/useAccountPreviewTransactions.ts | 9 +++++++-- upcoming-release-notes/3873.md | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 upcoming-release-notes/3873.md diff --git a/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts b/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts index 04b630f43d1..ca1471c999b 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 00000000000..a1843db3a31 --- /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)