Merge pull request #1980 from khassel/socketclient_fix

socketclient.js: add backward compatibility for old module code
This commit is contained in:
Michael Teeuw 2020-04-09 13:50:38 +02:00 committed by GitHub
commit fc624359c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed ### Fixed
- The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973) - 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 ## [2.11.0] - 2020-04-01

View File

@ -8,8 +8,12 @@ var MMSocket = function(moduleName) {
self.moduleName = moduleName; self.moduleName = moduleName;
// Private Methods // Private Methods
var base = "/";
if ((typeof config !== "undefined") && (typeof config.basePath !== "undefined")) {
base = config.basePath;
}
self.socket = io("/" + self.moduleName, { self.socket = io("/" + self.moduleName, {
path: config.basePath + "socket.io" path: base + "socket.io"
}); });
var notificationCallback = function() {}; var notificationCallback = function() {};