Skip to content

Commit 84c7382

Browse files
committed
fix: handling notification exceptions on Android
1 parent a337896 commit 84c7382

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

arc/js/notify.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010
notify_methods = {
1111
create_notification: function(options) {
1212
if( typeof(Notification) == 'function' ) {
13-
return new Notification(options.title, options);
14-
} else {
15-
return null;
16-
}
13+
try {
14+
return new Notification(options.title, options);
15+
}
16+
catch(err) {
17+
console.log(err);
18+
}
19+
}
20+
return null;
1721
},
1822
close_notification: function(notification, options) {
1923
return setTimeout(notification.close.bind(notification), options.closeTime);

0 commit comments

Comments
 (0)