diff --git a/src/app/context/AccountContext.tsx b/src/app/context/AccountContext.tsx index 771a5354b1..71c64b2675 100644 --- a/src/app/context/AccountContext.tsx +++ b/src/app/context/AccountContext.tsx @@ -143,10 +143,9 @@ export function AccountProvider({ children }: { children: React.ReactNode }) { if (!response.configured && !onWelcomePage) { utils.openPage("welcome.html"); window.close(); + } else if (response.configured && onWelcomePage) { + utils.redirectPage("options.html"); } else if (response.unlocked) { - if (response.configured && onWelcomePage) { - utils.redirectPage("options.html"); - } selectAccount(response.currentAccountId, true); } else { setAccount(null); diff --git a/src/app/router/Welcome/Welcome.tsx b/src/app/router/Welcome/Welcome.tsx index e4bd3b04c8..9d379b9d13 100644 --- a/src/app/router/Welcome/Welcome.tsx +++ b/src/app/router/Welcome/Welcome.tsx @@ -7,6 +7,7 @@ import { useTranslation } from "react-i18next"; import { Outlet, Route, HashRouter as Router, Routes } from "react-router-dom"; import Container from "~/app/components/Container"; import Toaster from "~/app/components/Toast/Toaster"; +import { AccountProvider } from "~/app/context/AccountContext"; import { SettingsProvider } from "~/app/context/SettingsContext"; import { getConnectorRoutes, renderRoutes } from "~/app/router/connectorRoutes"; import ChooseConnectorPath from "~/app/screens/connectors/ChooseConnectorPath"; @@ -17,34 +18,36 @@ const connectorRoutes = getConnectorRoutes(); function Welcome() { return ( - - - - }> - } /> - - }> - - - } - > - {renderRoutes(connectorRoutes)} + + + + + }> + } /> + + }> + + + } + > + {renderRoutes(connectorRoutes)} + + } /> + } /> - } /> - } /> - - - + + + ); }