about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorSorin Davidoi <sorin.davidoi@gmail.com>2017-08-01 06:00:13 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-08-01 06:00:13 +0200
commitd4c4820c03a081ef182407c2db16f27d0420335e (patch)
tree9d594f6ed1a71099d2c1a44d3f5d06b66ece9eab /app/javascript
parente05606c8d0b1a77dd5153da04fe5ec9f192be0b7 (diff)
fix(web_push_notifications): Send message with welcome notifications (#4471)
* fix(web_push_notifications): Send grouping title in welcome notification

* fix(web_push_notifications): Read message from last notification
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/service_worker/web_push_notifications.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/service_worker/web_push_notifications.js b/app/javascript/mastodon/service_worker/web_push_notifications.js
index 64c457889..acb85f626 100644
--- a/app/javascript/mastodon/service_worker/web_push_notifications.js
+++ b/app/javascript/mastodon/service_worker/web_push_notifications.js
@@ -9,7 +9,7 @@ const notify = options =>
     if (notifications.length === MAX_NOTIFICATIONS) {
       // Reached the maximum number of notifications, proceed with grouping
       const group = {
-        title: formatGroupTitle(notifications[0].data.message, notifications.length + 1),
+        title: formatGroupTitle(options.data.message, notifications.length + 1),
         body: notifications
           .sort((n1, n2) => n1.timestamp < n2.timestamp)
           .map(notification => notification.title).join('\n'),
@@ -19,7 +19,7 @@ const notify = options =>
         data: {
           url: (new URL('/web/notifications', self.location)).href,
           count: notifications.length + 1,
-          message: notifications[0].data.message,
+          message: options.data.message,
         },
       };