From e58d088b5f4637726f93524dc1325232f89b5738 Mon Sep 17 00:00:00 2001 From: James Murdza Date: Fri, 7 Jun 2024 13:01:28 -0400 Subject: [PATCH] Replace references to the app base URL with a dynamically generated URL. --- frontend/components/editor/index.tsx | 2 +- frontend/components/editor/navbar/share.tsx | 2 +- frontend/components/editor/preview/index.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/components/editor/index.tsx b/frontend/components/editor/index.tsx index e3f3030..42a715d 100644 --- a/frontend/components/editor/index.tsx +++ b/frontend/components/editor/index.tsx @@ -42,7 +42,7 @@ export default function CodeEditor({ reactDefinitionFile: string }) { const socket = io( - `http://localhost:${process.env.NEXT_PUBLIC_SERVER_PORT}?userId=${userData.id}&sandboxId=${sandboxData.id}`, + `${window.location.protocol}//${window.location.hostname}:${process.env.NEXT_PUBLIC_SERVER_PORT}?userId=${userData.id}&sandboxId=${sandboxData.id}`, { timeout: 2000, } diff --git a/frontend/components/editor/navbar/share.tsx b/frontend/components/editor/navbar/share.tsx index 1821c9b..0974c38 100644 --- a/frontend/components/editor/navbar/share.tsx +++ b/frontend/components/editor/navbar/share.tsx @@ -120,7 +120,7 @@ export default function ShareSandboxModal({