Skip to content

Commit

Permalink
fix: handling notification exceptions on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Apr 17, 2018
1 parent a337896 commit 84c7382
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions arc/js/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
notify_methods = {
create_notification: function(options) {
if( typeof(Notification) == 'function' ) {
return new Notification(options.title, options);
} else {
return null;
}
try {
return new Notification(options.title, options);
}
catch(err) {
console.log(err);
}
}
return null;
},
close_notification: function(notification, options) {
return setTimeout(notification.close.bind(notification), options.closeTime);
Expand Down

0 comments on commit 84c7382

Please sign in to comment.