diff --git a/web/app/components/workflow-app/components/workflow-main.tsx b/web/app/components/workflow-app/components/workflow-main.tsx index f7b9264384..d310d0383c 100644 --- a/web/app/components/workflow-app/components/workflow-main.tsx +++ b/web/app/components/workflow-app/components/workflow-main.tsx @@ -41,7 +41,17 @@ const WorkflowMain = ({ const containerRef = useRef(null) const store = useStoreApi() - const { startCursorTracking, stopCursorTracking, onlineUsers } = useCollaboration(appId, store) + const { startCursorTracking, stopCursorTracking, onlineUsers, cursors, isConnected } = useCollaboration(appId, store) + const [myUserId, setMyUserId] = useState(null) + + useEffect(() => { + if (isConnected) + setMyUserId('current-user') + }, [isConnected]) + + const filteredCursors = Object.fromEntries( + Object.entries(cursors).filter(([userId]) => userId !== myUserId), + ) useEffect(() => { if (containerRef.current) @@ -133,18 +143,6 @@ const WorkflowMain = ({ handleWorkflowStartRunInWorkflow, } = useWorkflowStartRun() - const { cursors, isConnected } = useCollaboration(appId) - const [myUserId, setMyUserId] = useState(null) - - useEffect(() => { - if (isConnected) - setMyUserId('current-user') - }, [isConnected]) - - const filteredCursors = Object.fromEntries( - Object.entries(cursors).filter(([userId]) => userId !== myUserId), - ) - const { fetchInspectVars } = useSetWorkflowVarsWithValue({ flowId: appId, ...useConfigsMap(),