Skip to content

Commit

Permalink
Merge pull request #2443 from stakwork/feature/command-for-projectid
Browse files Browse the repository at this point in the history
feat: added command for cockets to pass projectid
  • Loading branch information
Rassl authored Nov 11, 2024
2 parents b480ec9 + d35174d commit 325431b
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 325431b

Please sign in to comment.