Skip to content
Snippets Groups Projects
Commit 26727cf8 authored by hristoterezov's avatar hristoterezov
Browse files

fix(remotecontrol): format of events

parent 20351a47
No related branches found
No related tags found
No related merge requests found
...@@ -68,8 +68,12 @@ class RemoteControl { ...@@ -68,8 +68,12 @@ class RemoteControl {
this.windowManager = windowManager; this.windowManager = windowManager;
this.channel = channel; this.channel = channel;
this.channel.ready(() => { this.channel.ready(() => {
this.channel.listen(REMOTE_CONTROL_EVENT_TYPE, this.channel.listen('message', message => {
event => this.onRemoteControlEvent(event)); const event = message.data;
if(event.name === REMOTE_CONTROL_EVENT_TYPE) {
this.onRemoteControlEvent(event);
}
});
this.sendEvent({type: EVENT_TYPES.supported}); this.sendEvent({type: EVENT_TYPES.supported});
}); });
} }
...@@ -199,9 +203,13 @@ class RemoteControl { ...@@ -199,9 +203,13 @@ class RemoteControl {
* @param {Object} event the remote control event. * @param {Object} event the remote control event.
*/ */
sendEvent(event) { sendEvent(event) {
const remoteControlEvent = Object.assign(
{ name: REMOTE_CONTROL_EVENT_TYPE },
event
);
this.channel.send({ this.channel.send({
method: REMOTE_CONTROL_EVENT_TYPE, method: 'message',
params: [event] params: { data: remoteControlEvent }
}); });
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment