better disconnect error managment

This commit is contained in:
les 2021-03-11 10:39:09 +01:00
parent d046b436b6
commit 8e72488417
4 changed files with 19 additions and 10 deletions

View file

@ -220,6 +220,9 @@ export class WorkerBasedMumbleClient extends EventEmitter {
args[2] = args[2].map((id) => this._user(id))
args[3] = args[3].map((id) => this._channel(id))
args[4] = args[4].map((id) => this._channel(id))
} else if (name === 'error') {
this.emit('error', args)
return
}
args.unshift(name)
this.emit.apply(this, args)

View file

@ -44,13 +44,21 @@ import 'subworkers'
function registerEventProxy (id, obj, event, transform) {
obj.on(event, function (_) {
postMessage({
clientId: id.client,
channelId: id.channel,
userId: id.user,
event: event,
value: transform ? transform.apply(null, arguments) : Array.from(arguments)
})
if (event === 'error') {
postMessage({
clientId: id.client,
event,
value: 'Error'
})
} else {
postMessage({
clientId: id.client,
channelId: id.channel,
userId: id.user,
event: event,
value: transform ? transform.apply(null, arguments) : Array.from(arguments)
})
}
})
}

View file

@ -58,8 +58,6 @@
"web-audio-buffer-queue": "^1.1.0",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11",
"worker-loader": "^2.0.0"
},
"optionalDependencies": {}

View file

@ -2,7 +2,7 @@ var theme = '../themes/MetroMumbleLight'
var path = require('path');
module.exports = {
mode: 'development',
mode: 'production',
entry: {
index: [
'./app/index.js',