From 413355708654e7f7c4a8c8ee3377c6820118296c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 28 Apr 2021 11:50:14 +0200 Subject: [PATCH] Do not send or apply undefined args over WebSocket --- src/player.js | 2 ++ src/widgetRemote.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/player.js b/src/player.js index effeb300..1dcd05cf 100644 --- a/src/player.js +++ b/src/player.js @@ -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': diff --git a/src/widgetRemote.js b/src/widgetRemote.js index a479a7c0..17f3454f 100644 --- a/src/widgetRemote.js +++ b/src/widgetRemote.js @@ -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);