Skip to content

Commit

Permalink
[FIX] Fix sticky notifications not working (#18285)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Jul 17, 2020
1 parent 1b31cb6 commit 02d69d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/ui/client/lib/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ export const KonchatNotification = {
if (window.Notification && Notification.permission === 'granted') {
const message = { rid: notification.payload != null ? notification.payload.rid : undefined, msg: notification.text, notification: true };
return promises.run('onClientMessageReceived', message).then(function(message) {
const requireInteraction = getUserPreference(Meteor.userId(), 'desktopNotificationRequireInteraction');
const n = new Notification(notification.title, {
icon: notification.icon || getUserAvatarURL(notification.payload.sender.username),
body: s.stripTags(message.msg),
tag: notification.payload._id,
silent: true,
canReply: true,
requireInteraction: getUserPreference(Meteor.userId(), 'desktopNotificationRequireInteraction'),
requireInteraction,
});

const notificationDuration = notification.duration - 0 || 10;
const notificationDuration = !requireInteraction && (notification.duration - 0 || 10);
if (notificationDuration > 0) {
setTimeout(() => n.close(), notificationDuration * 1000);
}
Expand Down

0 comments on commit 02d69d0

Please sign in to comment.