Do not send or apply undefined args over WebSocket

This commit is contained in:
Rafał Dzięgiel
2021-04-28 11:50:14 +02:00
parent d926e6b389
commit 4133557086
2 changed files with 3 additions and 1 deletions

View File

@@ -386,6 +386,8 @@ class ClapperPlayer extends GstClapper.Clapper
case 'toggle_play':
case 'play':
case 'pause':
this[action]();
break;
case 'set_playlist':
case 'append_playlist':
case 'set_subtitles':

View File

@@ -27,7 +27,7 @@ class ClapperWidgetRemote extends Gtk.Grid
this.togglePlayButton.remove_css_class('flat');
this.togglePlayButton.child.add_css_class('playbackicon');
this.togglePlayButton.connect(
'clicked', this.sendWs.bind(this, 'toggle_play')
'clicked', () => this.sendWs('toggle_play')
);
this.attach(this.togglePlayButton, 0, 0, 1, 1);