better disconnect error managment
This commit is contained in:
parent
d046b436b6
commit
8e72488417
4 changed files with 19 additions and 10 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -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": {}
|
||||
|
|
|
@ -2,7 +2,7 @@ var theme = '../themes/MetroMumbleLight'
|
|||
var path = require('path');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
mode: 'production',
|
||||
entry: {
|
||||
index: [
|
||||
'./app/index.js',
|
||||
|
|
Loading…
Reference in a new issue