From 67eb10878cd6aea0940b8ff60dd1500cd052f7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Fri, 24 Jan 2025 09:31:14 +0000 Subject: [PATCH] fix(web): use the "finish" in InstallationFinished component --- web/src/App.tsx | 4 ++-- web/src/components/core/InstallationFinished.test.tsx | 2 +- web/src/components/core/InstallationFinished.tsx | 8 ++------ web/src/types/status.ts | 1 + 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index 06b45ba55d..dc3b01e317 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -55,11 +55,11 @@ function App() { const Content = () => { if (error) return ; - if (phase === InstallationPhase.Install && isBusy) { + if (phase === InstallationPhase.Install) { return ; } - if (phase === InstallationPhase.Install && !isBusy) { + if (phase === InstallationPhase.Finish) { return ; } diff --git a/web/src/components/core/InstallationFinished.test.tsx b/web/src/components/core/InstallationFinished.test.tsx index c96ed26e37..91432a6ed8 100644 --- a/web/src/components/core/InstallationFinished.test.tsx +++ b/web/src/components/core/InstallationFinished.test.tsx @@ -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"; diff --git a/web/src/components/core/InstallationFinished.tsx b/web/src/components/core/InstallationFinished.tsx index 3a609043a6..060bc8bf2f 100644 --- a/web/src/components/core/InstallationFinished.tsx +++ b/web/src/components/core/InstallationFinished.tsx @@ -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 ; } - if (isBusy) { - return ; - } - return (
diff --git a/web/src/types/status.ts b/web/src/types/status.ts index 1aa07ace86..7c598f69b2 100644 --- a/web/src/types/status.ts +++ b/web/src/types/status.ts @@ -27,6 +27,7 @@ enum InstallationPhase { Startup = 0, Config = 1, Install = 2, + Finish = 3, } /*