From edab51c51997f17553e037dc7c2b5e5fa6ea8ffe Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Tue, 7 Mar 2023 15:37:22 +0500 Subject: [PATCH] fix: add location.pathname to location.origin conditionally --- web/src/containers/Studio/internal/components/runMenu.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/containers/Studio/internal/components/runMenu.tsx b/web/src/containers/Studio/internal/components/runMenu.tsx index 4ab3b8f..9c9c4ae 100644 --- a/web/src/containers/Studio/internal/components/runMenu.tsx +++ b/web/src/containers/Studio/internal/components/runMenu.tsx @@ -31,7 +31,10 @@ const RunMenu = ({ handleRunBtnClick }: RunMenuProps) => { const launchProgram = () => { - const baseUrl = window.location.origin + window.location.pathname + const pathName = + window.location.pathname === '/' ? '' : window.location.pathname + const baseUrl = window.location.origin + pathName + window.open(`${baseUrl}/SASjsApi/stp/execute?_program=${selectedFilePath}`) }