Skip to content

Commit

Permalink
Fixes dat.gui listener state display.
Browse files Browse the repository at this point in the history
Was holding on to a reference to the original listener after switching
between WebSocket and HTTP listeners. So it would show the status for
WebSocket listener, but never update for the HTTP listener.
  • Loading branch information
mildmojo committed Oct 7, 2017
1 parent d121f19 commit 64fc756
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Set up dat.gui for switching connection types and params at runtime.
var gui = new dat.GUI();
gui.add(guiController, 'mode').listen();
gui.add(guiController.listener, 'state').listen();
gui.add(guiController, 'state').listen();
gui.add(guiController, 'stopAll');
gui.add(guiController, 'startWebSocket');
gui.add(guiController, 'startHTTPPolling');
Expand All @@ -38,6 +38,7 @@
var guiController = {
mode: 'WebSocket Events',
listener: null,
get state() { return this.listener.state; },
startWebSocket: function() {
if (this.listener) this.listener.stop();
this.mode = 'WebSocket Events';
Expand Down

0 comments on commit 64fc756

Please sign in to comment.