Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unrelated to the rest of the PR.

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