Skip to content

A local-first personal finance app

fix preview transactions not showing on multi-account views (#5135)

Matt Fiddamaneb35b41c6ddc
diff --git a/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts b/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts
index c100b623b4..b10786807d 100644
--- a/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts
+++ b/packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts
@@ -58,6 +58,7 @@ export function useAccountPreviewTransactions({
const accountSchedulesFilter = useCallback(
(schedule: ScheduleEntity) =>
+ !accountId ||
schedule._account === accountId ||
getTransferAccountByPayee(schedule._payee)?.id === accountId,
[accountId, getTransferAccountByPayee],
@@ -82,10 +83,10 @@ export function useAccountPreviewTransactions({
return useMemo(() => {
if (!accountId) {
return {
- previewTransactions: [],
- runningBalances: new Map(),
- isLoading: false,
- error: undefined,
+ previewTransactions: allPreviewTransactions,
+ runningBalances: allRunningBalances,
+ isLoading,
+ error,
};
}
diff --git a/upcoming-release-notes/5135.md b/upcoming-release-notes/5135.md
new file mode 100644
index 0000000000..46ebbbb732
--- /dev/null
+++ b/upcoming-release-notes/5135.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [matt-fidd]
+---
+
+Fix preview transactions not showing on multi-account views