Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Fixing my merge error for PR #1378 Optional event emit instead of fun…
Browse files Browse the repository at this point in the history
…ction call for action buttons
  • Loading branch information
macdonst committed Apr 29, 2017
1 parent 83238fc commit 057cbd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/js/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ class PushNotification {
*/

on(eventName, callback) {
if (this.handlers.hasOwnProperty(eventName)) {
this.handlers[eventName].push(callback);
if (!this.handlers.hasOwnProperty(eventName)) {
this.handlers[eventName] = [];
}
this.handlers[eventName].push(callback);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions www/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ var PushNotification = function () {
}, {
key: 'on',
value: function on(eventName, callback) {
if (this.handlers.hasOwnProperty(eventName)) {
this.handlers[eventName].push(callback);
if (!this.handlers.hasOwnProperty(eventName)) {
this.handlers[eventName] = [];
}
this.handlers[eventName].push(callback);
}

/**
Expand Down

0 comments on commit 057cbd1

Please sign in to comment.