Skip to content

Commit

Permalink
feat: added command for cockets to pass projectid
Browse files Browse the repository at this point in the history
  • Loading branch information
Rassl committed Nov 11, 2024
1 parent b480ec9 commit d35174d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d35174d

Please sign in to comment.