Skip to content

Commit

Permalink
fix(web): use the "finish" in InstallationFinished component
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Jan 24, 2025
1 parent 881869e commit 67eb108
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ function App() {
const Content = () => {
if (error) return <ServerError />;

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

if (phase === InstallationPhase.Install && !isBusy) {
if (phase === InstallationPhase.Finish) {
return <Navigate to={ROOT.installationFinished} />;
}

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/core/InstallationFinished.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { Encryption } from "~/api/storage/types/config";

jest.mock("~/queries/status", () => ({
...jest.requireActual("~/queries/status"),
useInstallerStatus: () => ({ isBusy: false, useIguana: false, phase: 2, canInstall: false }),
useInstallerStatus: () => ({ isBusy: false, useIguana: false, phase: 3, canInstall: false }),
}));

type storageConfigType = "guided" | "raw";
Expand Down
8 changes: 2 additions & 6 deletions web/src/components/core/InstallationFinished.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,13 @@ function usingTpm(config): boolean {
}

function InstallationFinished() {
const { phase, isBusy, useIguana } = useInstallerStatus({ suspense: true });
const { phase, useIguana } = useInstallerStatus({ suspense: true });
const config = useConfig();

if (phase !== InstallationPhase.Install) {
if (phase !== InstallationPhase.Finish) {
return <Navigate to={PATHS.root} />;
}

if (isBusy) {
return <Navigate to={PATHS.installationProgress} />;
}

return (
<Center>
<Grid hasGutter>
Expand Down
1 change: 1 addition & 0 deletions web/src/types/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum InstallationPhase {
Startup = 0,
Config = 1,
Install = 2,
Finish = 3,
}

/*
Expand Down

0 comments on commit 67eb108

Please sign in to comment.