Revert "temporary client compatibility workaround."

This commit is contained in:
Miroslav Šedivý 2021-09-09 19:59:52 +02:00
parent f67ceae472
commit 07b5ba0977

View File

@ -72,12 +72,11 @@ export class NekoWebSocket extends EventEmitter<NekoWebSocketEvents> {
} }
this._log.debug(`sending event '${event}' ${payload ? `with payload: ` : ''}`, payload) this._log.debug(`sending event '${event}' ${payload ? `with payload: ` : ''}`, payload)
this._ws!.send(JSON.stringify({ event, payload, ...payload })) this._ws!.send(JSON.stringify({ event, payload }))
} }
private onMessage(e: MessageEvent) { private onMessage(e: MessageEvent) {
const { event, ...data } = JSON.parse(e.data) const { event, payload } = JSON.parse(e.data)
const payload = 'payload' in data ? data.payload : data
this._log.debug(`received websocket event ${event} ${payload ? `with payload: ` : ''}`, payload) this._log.debug(`received websocket event ${event} ${payload ? `with payload: ` : ''}`, payload)
this.emit('message', event, payload) this.emit('message', event, payload)