Merge pull request #1143 from shbatm/bug-fix

Fix for #1140 - sendNotification module errors after #1116
This commit is contained in:
Michael Teeuw 2018-01-18 13:35:47 +01:00 committed by GitHub
commit d5040c091a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
/* global Log, Loader, Module, config, defaults */ /* global Log, Loader, Module, config, defaults */
/* jshint -W020 */ /* jshint -W020, esversion: 6 */
/* Magic Mirror /* Magic Mirror
* Main System * Main System
@ -89,7 +89,8 @@ var MM = (function() {
* argument sendTo Module - The module to send the notification to. (optional) * argument sendTo Module - The module to send the notification to. (optional)
*/ */
var sendNotification = function(notification, payload, sender, sendTo) { var sendNotification = function(notification, payload, sender, sendTo) {
for (var module of modules) { for (var m in modules) {
var module = modules[m];
if (module !== sender && (!sendTo || module === sendTo)) { if (module !== sender && (!sendTo || module === sendTo)) {
module.notificationReceived(notification, payload, sender); module.notificationReceived(notification, payload, sender);
} }