[go: nahoru, domu]

Skip to content

Commit

Permalink
Changed a websocket state connection in friends
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ameli committed May 31, 2023
1 parent 9ba4aae commit 6eab889
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/app/friends/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ export default function FriendsPage() {

// Setting the websocket connection
useEffect(() => {
if (!session) return
if (ws) return
if (!session || ws) return

const url = `${getServerUrl(false)}/ws/friends/${session.user.id}/`
setWs(new WebSocket(url))
setWs(() => new WebSocket(url))
}, [session, ws])

// Handling on message events
Expand Down

1 comment on commit 6eab889

@vercel
Copy link
@vercel vercel bot commented on 6eab889 May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.