From 37ee0e568f9b451281d9cbb819fba6f131a7a76b Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Tue, 7 Apr 2020 19:35:21 +0200 Subject: [PATCH 1/3] socketclient.js: add backward compatibility for old module code --- js/socketclient.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/socketclient.js b/js/socketclient.js index 7be9ce7d..5f24baf5 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -8,8 +8,12 @@ var MMSocket = function(moduleName) { self.moduleName = moduleName; // Private Methods + var base = "/"; + if (typeof config !== "undefined") { + base = config.basePath; + } self.socket = io("/" + self.moduleName, { - path: config.basePath + "socket.io" + path: base + "socket.io" }); var notificationCallback = function() {}; From 1fd36458a65be9e071f6e9f7ba323e5be1581e20 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Tue, 7 Apr 2020 19:42:16 +0200 Subject: [PATCH 2/3] update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3ccf583..18a89fe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973) +- Add backward compatibilty for old module code in socketclient.js [#1973](https://github.com/MichMich/MagicMirror/issues/1973) ## [2.11.0] - 2020-04-01 From 19145736342399effac1c5f4615518d5b6543d67 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Tue, 7 Apr 2020 20:26:09 +0200 Subject: [PATCH 3/3] fixed again ... --- js/socketclient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/socketclient.js b/js/socketclient.js index 5f24baf5..d10c0d60 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -9,7 +9,7 @@ var MMSocket = function(moduleName) { // Private Methods var base = "/"; - if (typeof config !== "undefined") { + if ((typeof config !== "undefined") && (typeof config.basePath !== "undefined")) { base = config.basePath; } self.socket = io("/" + self.moduleName, {