Skip to content

Instantly share code, notes, and snippets.

@cimfalab
Created August 12, 2017 07:03
Show Gist options
  • Save cimfalab/017279ceb15868abb1408547495a37a5 to your computer and use it in GitHub Desktop.
Save cimfalab/017279ceb15868abb1408547495a37a5 to your computer and use it in GitHub Desktop.
alert.js
notificationReceived: function(notification, payload, sender) {
if (notification === "SHOW_ALERT") {
if (typeof payload.type === "undefined") { payload.type = "alert"; }
if (payload.type == "alert") {
this.show_alert(payload, sender);
} else if (payload.type = "notification") {
this.show_notification(payload);
}
} else if (notification === "HIDE_ALERT") {
this.hide_alert(sender);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment