From 2fe71a7b6233f918cfd1901e8de4f56654498198 Mon Sep 17 00:00:00 2001 From: Dev-CasperTheGhost <53900565+Dev-CasperTheGhost@users.noreply.github.com> Date: Fri, 5 Nov 2021 15:31:54 +0100 Subject: [PATCH] :bug: fix: use .env url for socket --- packages/client/src/pages/_app.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/client/src/pages/_app.tsx b/packages/client/src/pages/_app.tsx index 103b32e51..5bdb0f234 100644 --- a/packages/client/src/pages/_app.tsx +++ b/packages/client/src/pages/_app.tsx @@ -7,6 +7,7 @@ import { ValuesProvider } from "context/ValuesContext"; import { CitizenProvider } from "context/CitizenContext"; import "styles/globals.scss"; import { SocketProvider } from "@casper124578/use-socket.io"; +import { findUrl } from "lib/fetch"; const styles: React.CSSProperties = { minWidth: "20em", @@ -16,9 +17,12 @@ const styles: React.CSSProperties = { }; export default function App({ Component, router, pageProps }: AppProps) { + const { hostname, protocol, port } = new URL(findUrl()); + const url = `${protocol}//${hostname}:${port}`; + return (