From bbf39cc9f0cacca8a1ecb05b861784876be45040 Mon Sep 17 00:00:00 2001 From: Timo Wagner Date: Sat, 27 Apr 2024 00:54:14 +0200 Subject: [PATCH 1/2] Fix connection to lobby socket --- views/admin/overview.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/admin/overview.twig b/views/admin/overview.twig index 816753b..112dcd2 100644 --- a/views/admin/overview.twig +++ b/views/admin/overview.twig @@ -3,7 +3,7 @@ {% block header %} {% endblock %} From 250b31a7a2161f19e8e945d6c9cc5c5c8537514f Mon Sep 17 00:00:00 2001 From: Timo Wagner Date: Wed, 1 May 2024 21:43:48 +0200 Subject: [PATCH 2/2] Add proper removal of dispatcher event for the adminlobby --- modules/adminLobby.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/adminLobby.js b/modules/adminLobby.js index 92706fb..54047ca 100644 --- a/modules/adminLobby.js +++ b/modules/adminLobby.js @@ -105,13 +105,18 @@ export default class adminLobby { socket.on('controls.pause', function (data) { getAdminView(data.displayId).controls("pause"); }); - - dispatcher.on("dashboard.update", function (data) { + + cli.info('admin lobby adding dispatcher on dashboard.update count:' + dispatcher.rawListeners("dashboard.update").length); + let dashboardUpdateHandler = function (data) { socket.emit("callback.serverOptions", [data]); - }); + }; + dispatcher.on("dashboard.update", dashboardUpdateHandler); + socket.on("disconnect", function (s) { + dispatcher.removeListener('dashboard.update', dashboardUpdateHandler); + cli.info("admin lobby socket disconnect"); + }) }); - function updateSlides(bundleName, bundleData) { for (let aView of adminView) { aView.updateSlides();