]> cat aescling's git repositories - mastodon.git/commitdiff
Add tag property to desktop notifications, preventing duplicates (i.e. when multiple...
authorEffy Elden <git@effy.is>
Thu, 5 Jan 2017 21:26:45 +0000 (08:26 +1100)
committerEffy Elden <git@effy.is>
Thu, 5 Jan 2017 21:26:45 +0000 (08:26 +1100)
app/assets/javascripts/components/actions/notifications.jsx

index 8bd83540631a4c944edf04ccbb09e325f5905ec1..182b598aa5372fa723673659763e27740c092128 100644 (file)
@@ -40,7 +40,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
       const title = new IntlMessageFormat(intlMessages[`notification.${notification.type}`], intlLocale).format({ name: notification.account.display_name.length > 0 ? notification.account.display_name : notification.account.username });
       const body  = $('<p>').html(notification.status ? notification.status.content : '').text();
 
-      new Notification(title, { body, icon: notification.account.avatar });
+      new Notification(title, { body, icon: notification.account.avatar, tag: notification.id });
     }
   };
 };