wait to subscribe to stream if it isnt open yet

This commit is contained in:
tjs 2023-03-31 20:14:59 -04:00
parent 6067dd1665
commit c594011202
1 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,9 @@ export function subscribeOnStream(
}
if (!isOpen(socket)) {
console.warn('Socket Closed')
socket.addEventListener('open', (_event) => {
socket.send(JSON.stringify(msg))
})
return
}
console.warn('[subscribeBars birdeye]')