Skip to content

Commit

Permalink
Merge pull request #2236 from stakwork/feature/stack-socket
Browse files Browse the repository at this point in the history
feat: add stack socket connect
  • Loading branch information
Rassl authored Sep 26, 2024
2 parents f6c7be1 + 10d99d8 commit 20bd3ba
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,32 @@ export const App = () => {
handleAiSummaryAudio,
])

useEffect(() => {
const ws = new WebSocket('wss://staging.stakwork.com/cable')

ws.onopen = () => {
console.log('WebSocket connection established')

Check warning on line 244 in src/components/App/index.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}

ws.onmessage = (event) => {
console.log('Message from server:', event.data)

Check warning on line 248 in src/components/App/index.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
// Handle the message from the server here
}

ws.onerror = (error) => {
console.error('WebSocket error:', error)
}

ws.onclose = () => {
console.log('WebSocket connection closed')

Check warning on line 257 in src/components/App/index.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}

// Cleanup when the component is unmounted
return () => {
ws.close()
}
}, [])

useEffect(() => {
if (!splashDataLoading) {
setUniverseQuestionIsOpen()
Expand Down

0 comments on commit 20bd3ba

Please sign in to comment.