From f931316dc8fc72501caf7122fd5deeffc3421930 Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Sun, 3 Apr 2016 20:34:47 +0200 Subject: [PATCH] No type = alert --- modules/default/alert/README.md | 2 +- modules/default/alert/alert.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/default/alert/README.md b/modules/default/alert/README.md index 81c133db..ced23b42 100644 --- a/modules/default/alert/README.md +++ b/modules/default/alert/README.md @@ -78,7 +78,7 @@ self.sendNotification("SHOW_ALERT", {type: "notification"}); For alerts use: ``` -self.sendNotification("SHOW_ALERT", {type: "alert"}); +self.sendNotification("SHOW_ALERT", {}); ``` ### Notification params diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index 03fcf1c2..dec635c1 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -94,6 +94,7 @@ Module.register('alert',{ }, notificationReceived: function(notification, payload, sender) { + if (typeof payload.type === 'undefined') { payload.type = "alert"; } if (notification === 'SHOW_ALERT') { if (payload.type == "alert"){ this.show_alert(payload, sender)