From a577db89faa3788fb7ad51121c3da18652ef404f Mon Sep 17 00:00:00 2001 From: Arnaud Date: Mon, 11 Nov 2024 09:47:09 +0700 Subject: [PATCH] Do not block when port forwarding is not enabled --- src/components/HealthChecks/HealthChecks.tsx | 36 +++++++++----------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/components/HealthChecks/HealthChecks.tsx b/src/components/HealthChecks/HealthChecks.tsx index 7efb698..abc16dd 100644 --- a/src/components/HealthChecks/HealthChecks.tsx +++ b/src/components/HealthChecks/HealthChecks.tsx @@ -37,14 +37,10 @@ export function HealthChecks({ online, onStepValid }: Props) { useEffect( () => { - if (codex.isSuccess) { - persistence.refetch(); - portForwarding.refetch().then(({ data }) => { - onStepValid(data?.reachable || false); - }); - } else { - onStepValid(false); - } + persistence.refetch(); + portForwarding.refetch(); + + onStepValid(codex.isSuccess); }, // We really do not want to add persistence and portForwarding as // dependencies because it will cause a re-render every time. @@ -163,18 +159,6 @@ export function HealthChecks({ online, onStepValid }: Props) { Internet connection -
  • - - {portForwarding.isFetching ? ( - - ) : portForwarding.enabled ? ( - - ) : ( - - )} - - Port forwarding -
  • {codex.isFetching ? ( @@ -187,6 +171,18 @@ export function HealthChecks({ online, onStepValid }: Props) { Codex connection
  • +
  • + + {portForwarding.isFetching ? ( + + ) : portForwarding.enabled ? ( + + ) : ( + + )} + + Port forwarding +
  • {persistence.isFetching ? (