diff --git a/frontend/src/context/ContextApi.jsx b/frontend/src/context/ContextApi.jsx
index 3932dfd0..4e82ba1e 100644
--- a/frontend/src/context/ContextApi.jsx
+++ b/frontend/src/context/ContextApi.jsx
@@ -1,14 +1,15 @@
-import { createContext, useState, useEffect } from 'react';
+import React, { createContext, useState, useEffect } from 'react';
export const Context = createContext();
-export const AppContext =(props) => {
+export const AppContext = (props) => {
+ const { serverside } = props
- const currentLocation = window?.location?.pathname;
+ const currentLocation = serverside === true ? "" : window?.location?.pathname;
// Left side bar global states
const [searchBarModalOpen, setSearchBarModalOpen] = useState(false);
const [leftSideBarOpenByClick, setLeftSideBarOpenByClick] = useState(currentLocation?.includes('/workflows/') ? false : true)
- const [windowWidth, setWindowWidth] = useState(window.innerWidth);
+ const [windowWidth, setWindowWidth] = useState(serverside === true ? 100 : window.innerWidth);
useEffect(() => {
if (currentLocation?.includes('/workflows/') && leftSideBarOpenByClick === true) {
@@ -18,6 +19,10 @@ export const AppContext =(props) => {
//Calculate window width
useEffect(() => {
+ if (serverside === true) {
+ return
+ }
+
const handleResize = () => {
setWindowWidth(window?.innerWidth);
};
diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx
index 7a9c371e..6aa8ec08 100755
--- a/frontend/src/views/Docs.jsx
+++ b/frontend/src/views/Docs.jsx
@@ -694,8 +694,7 @@ const Docs = (defaultprops) => {