diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index b5eadffae..54d49022b 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -281,9 +281,7 @@ export const App = () => { const ws = new WebSocket('wss://jobs.stakwork.com/cable?channel=ProjectLogChannel') ws.onopen = () => { - let id = 'a' - - id = runningProjectId + const id = runningProjectId const command = { command: 'subscribe', @@ -321,6 +319,16 @@ export const App = () => { } }, [runningProjectId, setRunningProjectMessages]) + useEffect(() => { + if (runningProjectId) { + try { + socket?.emit('update_project_id', { id: runningProjectId }) + } catch (error) { + console.error(error) + } + } + }, [runningProjectId, socket]) + useEffect(() => { if (!splashDataLoading) { if (chatInterfaceFeatureFlag) {