Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async _connect (retry) {
this._socket = new Websock()
this._socket.open(this._addressGetter.audioURL())
this._socket.binaryType = 'arraybuffer'
this._socket.on('close', (event) => {
if (!event.wasClean && (event.code === 1006 && !retry)) {
this._userStore.dispatch('refreshToken')
.then(() => {
this._connect(true)
})
.catch((err) => {
this.emit(Events.error, err)
throw err
})
return
}
this.stopRecording()
if (!event.wasClean || (event.code !== 1000 && event.code !== 1005)) {