From da0154a41b08a7d67886cc2a64eef2ad2cb9e425 Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Tue, 17 Feb 2026 14:33:49 -0800 Subject: [PATCH] Fix redirect to accounts page when no accounts exists (#7007) * Fix redirect to accounts page when no accounts exists * Add release notes for PR #7007 * Use isFetching --------- Co-authored-by: github-actions[bot] --- .../src/components/FinancesApp.tsx | 18 ++++++++---------- upcoming-release-notes/7007.md | 6 ++++++ 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 upcoming-release-notes/7007.md diff --git a/packages/desktop-client/src/components/FinancesApp.tsx b/packages/desktop-client/src/components/FinancesApp.tsx index 9fe9c0c09c..ca05a40041 100644 --- a/packages/desktop-client/src/components/FinancesApp.tsx +++ b/packages/desktop-client/src/components/FinancesApp.tsx @@ -92,7 +92,7 @@ export function FinancesApp() { const { t } = useTranslation(); // TODO: Replace with `useAccounts` hook once it's updated to return the useQuery results. - const { data: accounts, isSuccess: isAccountsLoaded } = useQuery( + const { data: accounts, isFetching: isAccountsFetching } = useQuery( accountQueries.list(), ); @@ -245,16 +245,14 @@ export function FinancesApp() { 0 ? ( - - ) : ( - // If there are no accounts, we want to redirect the user to - // the All Accounts screen which will prompt them to add an account - - ) - ) : ( + isAccountsFetching || !accounts ? ( + ) : accounts.length > 0 ? ( + + ) : ( + // If there are no accounts, we want to redirect the user to + // the All Accounts screen which will prompt them to add an account + ) } /> diff --git a/upcoming-release-notes/7007.md b/upcoming-release-notes/7007.md new file mode 100644 index 0000000000..5f8716dd68 --- /dev/null +++ b/upcoming-release-notes/7007.md @@ -0,0 +1,6 @@ +--- +category: Bugfixes +authors: [joel-jeremy] +--- + +Fix redirect to accounts page when no accounts exist, improving user experience.