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.