diff --git a/frontend/components/Main/MainNeedsFunds.tsx b/frontend/components/Main/MainNeedsFunds.tsx
index 738eda621..60554d844 100644
--- a/frontend/components/Main/MainNeedsFunds.tsx
+++ b/frontend/components/Main/MainNeedsFunds.tsx
@@ -102,7 +102,7 @@ export const MainNeedsFunds = () => {
{`${serviceFundRequirements.eth} XDAI `}
- - for gas & trading balance.
+ - for trading balance.
)}
diff --git a/frontend/components/Setup/Create/SetupEoaFunding.tsx b/frontend/components/Setup/Create/SetupEoaFunding.tsx
index 6f0d8ad4c..dca8a6c31 100644
--- a/frontend/components/Setup/Create/SetupEoaFunding.tsx
+++ b/frontend/components/Setup/Create/SetupEoaFunding.tsx
@@ -30,7 +30,11 @@ import { useWallet } from '@/hooks/useWallet';
import { SetupCreateHeader } from './SetupCreateHeader';
-export const SetupEoaFunding = () => {
+export const SetupEoaFunding = ({
+ isIncomplete,
+}: {
+ isIncomplete?: boolean;
+}) => {
const { eoaBalance } = useBalance();
const { goto } = useSetup();
@@ -55,7 +59,10 @@ export const SetupEoaFunding = () => {
return (
-
+
Deposit {MIN_ETH_BALANCE_THRESHOLDS[Chain.GNOSIS].safeCreation} XDAI on
Gnosis
diff --git a/frontend/components/Setup/Setup.tsx b/frontend/components/Setup/Setup.tsx
index 799abcbfa..9e302585c 100644
--- a/frontend/components/Setup/Setup.tsx
+++ b/frontend/components/Setup/Setup.tsx
@@ -31,6 +31,8 @@ export const Setup = () => {
return ;
case SetupScreen.SetupEoaFunding:
return ;
+ case SetupScreen.SetupEoaFundingIncomplete:
+ return ;
case SetupScreen.SetupCreateSafe:
return ;
// Restore account
diff --git a/frontend/components/Setup/SetupWelcome.tsx b/frontend/components/Setup/SetupWelcome.tsx
index cf78db142..37d518626 100644
--- a/frontend/components/Setup/SetupWelcome.tsx
+++ b/frontend/components/Setup/SetupWelcome.tsx
@@ -13,7 +13,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
import { AccountIsSetup } from '@/client';
import { PageState, SetupScreen } from '@/enums';
-import { usePageState, useSetup } from '@/hooks';
+import { useBalance, usePageState, useSetup } from '@/hooks';
import { useElectronApi } from '@/hooks/useElectronApi';
import { useWallet } from '@/hooks/useWallet';
import { AccountService } from '@/service/Account';
@@ -104,9 +104,11 @@ export const SetupWelcomeLogin = () => {
const { goto } = useSetup();
const { goto: gotoPage } = usePageState();
- const { masterEoaAddress, masterSafeAddress } = useWallet();
+ const { masterSafeAddress, wallets } = useWallet();
+ const { isBalanceLoaded, eoaBalance } = useBalance();
const [isLoggingIn, setIsLoggingIn] = useState(false);
+ const [canNavigate, setCanNavigate] = useState(false);
const [form] = Form.useForm();
@@ -115,22 +117,40 @@ export const SetupWelcomeLogin = () => {
setIsLoggingIn(true);
AccountService.loginAccount(password)
.then(() => {
- if (masterEoaAddress && !masterSafeAddress) {
- gotoPage(PageState.Setup);
- goto(SetupScreen.SetupCreateSafe);
- } else {
- gotoPage(PageState.Main);
- }
+ setCanNavigate(true);
})
.catch((e) => {
console.error(e);
+ setIsLoggingIn(false);
message.error('Invalid password');
- })
- .finally(() => setIsLoggingIn(false));
+ });
},
- [goto, gotoPage, masterEoaAddress, masterSafeAddress],
+ [],
);
+ useEffect(() => {
+ // Navigate only when wallets and balances are loaded
+ // To check if some setup steps were missed
+ if (canNavigate && wallets?.length && isBalanceLoaded) {
+ setIsLoggingIn(false);
+ if (!eoaBalance?.ETH) {
+ goto(SetupScreen.SetupEoaFundingIncomplete);
+ } else if (!masterSafeAddress) {
+ goto(SetupScreen.SetupCreateSafe);
+ } else {
+ gotoPage(PageState.Main);
+ }
+ }
+ }, [
+ canNavigate,
+ eoaBalance?.ETH,
+ goto,
+ gotoPage,
+ isBalanceLoaded,
+ masterSafeAddress,
+ wallets?.length,
+ ]);
+
return (