Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WebSocket won't reconnect after going offline. #4573

zigomir started this conversation in General
Discussion options

I had to manually write a code like that

const ws = useWebSocket()

const { isOnline } = useNetwork()
watch(isOnline, async (value) => {
  if (value) {
    ws.open()
  }
  else {
    ws.close()
  }
})

in order to make WS reconnect after computer / network goes offline. I had an incorrect assumption that useWebSocket would handle that for me automatically.

Is this maybe by design or would you accepts such automated connection handling in form of a PR?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.