diff --git a/src/components/HealthChecks/HealthChecks.tsx b/src/components/HealthChecks/HealthChecks.tsx
index 4c65983..68ad76e 100644
--- a/src/components/HealthChecks/HealthChecks.tsx
+++ b/src/components/HealthChecks/HealthChecks.tsx
@@ -83,6 +83,8 @@ export function HealthChecks({ online, onStepValid }: Props) {
.then(() => codex.refetch());
};
+ const hasPort = HealthCheckUtils.hasPort(address);
+
return (
- Ensure that your Codex node is running on{" "}
-
- {HealthCheckUtils.removePort(address)}
- {" "}
- on port{" "}
- {HealthCheckUtils.getPort(address)}
- {}
+ {hasPort ? (
+ <>
+ Port detected is
+
+ {HealthCheckUtils.getPort(address)}
+
+ >
+ ) : (
+ <>
+ Port is not specified, default is
+
+ {HealthCheckUtils.getPort(address)}
+
+ >
+ )}
Ensure that port forwarding is enabled for your settings.
diff --git a/src/components/HealthChecks/health-check.utils.ts b/src/components/HealthChecks/health-check.utils.ts
index 1161dda..21f5ec5 100644
--- a/src/components/HealthChecks/health-check.utils.ts
+++ b/src/components/HealthChecks/health-check.utils.ts
@@ -14,6 +14,10 @@ export const HealthCheckUtils = {
return parseInt(url.split(":")[2] || defaultPort, 10);
},
+ hasPort(url: string) {
+ return !!url.split(":")[2];
+ },
+
containsPort(url: string) {
return url.split(":").length > 2;
},