Skip to content

Commit

Permalink
feat(web): show core/WelcomePage
Browse files Browse the repository at this point in the history
Based on the "agm-show-welcome-screen" flag stored in local storage.
  • Loading branch information
dgdavid committed Jan 24, 2025
1 parent a22e4c3 commit 696cc7b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) [2022-2024] SUSE LLC
* Copyright (c) [2022-2025] SUSE LLC
*
* All Rights Reserved.
*
Expand Down Expand Up @@ -34,12 +34,13 @@ import { useDeprecatedChanges } from "~/queries/storage";
import { useRootUser } from "~/queries/users";
import { ROOT, PRODUCT, USER } from "~/routes/paths";
import { InstallationPhase } from "~/types/status";
import { isEmpty } from "~/utils";
import { isEmpty, useLocalStorage } from "~/utils";

/**
* Main application component.
*/
function App() {
const [showWelcomePage] = useLocalStorage("agm-show-welcome-page", true);
const location = useLocation();
const { isBusy, phase } = useInstallerStatus({ suspense: true });
const { connected, error } = useInstallerClientStatus();
Expand All @@ -55,6 +56,10 @@ function App() {
const Content = () => {
if (error) return <ServerError />;

if (showWelcomePage) {
return <Navigate to={ROOT.welcomePage} />;
}

if (phase === InstallationPhase.Install && isBusy) {
return <Navigate to={ROOT.installationProgress} />;
}
Expand Down

0 comments on commit 696cc7b

Please sign in to comment.