From 6a12b3f2c1a846f2c995ddbf57f74f4f73fd4e28 Mon Sep 17 00:00:00 2001 From: Taylor Bantle Date: Tue, 28 Nov 2023 12:53:22 -0800 Subject: [PATCH] web: Fix lint --- .../pageComponents/ConnectionsPage/NewConnection/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx b/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx index b8b4759c..63d88c67 100644 --- a/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx +++ b/web/components/pageComponents/ConnectionsPage/NewConnection/index.tsx @@ -6,6 +6,7 @@ import Loader from "@components/Loader"; import { FaCaretDown } from "@react-icons/all-files/fa/FaCaretDown"; import { FaCaretUp } from "@react-icons/all-files/fa/FaCaretUp"; import cx from "classnames"; +import { useEffect, useState } from "react"; import css from "./index.module.css"; import useConfig from "./useConfig"; @@ -18,7 +19,11 @@ export default function NewConnection(props: Props) { const { onSubmit, state, setState, error, clearState } = useConfig(); const canSubmit = state.name && (state.connectionUrl || (state.host && state.username)); - const isDocker = location.origin === "http://localhost:3000"; + const [isDocker, setIsDocker] = useState(false); + + useEffect(() => { + setIsDocker(window.location.origin === "http://localhost:3000"); + }, []); const onCancel = props.canGoBack ? () => {