diff --git a/webapp/components/NotificationsTable/NotificationsTable.vue b/webapp/components/NotificationsTable/NotificationsTable.vue index 7065b2624..70d187d04 100644 --- a/webapp/components/NotificationsTable/NotificationsTable.vue +++ b/webapp/components/NotificationsTable/NotificationsTable.vue @@ -39,7 +39,9 @@ @@ -61,14 +63,18 @@ class="notification-mention-post" :class="{ 'notification-status': notification.read }" :to="{ - name: 'post-id-slug', + name: isGroup(notification.from) ? 'group' : 'post-id-slug', params: params(notification.from), hash: hashParam(notification.from), }" @click.native="markNotificationAsRead(notification.from.id)" > - {{ notification.from.title || notification.from.post.title | truncate(50) }} + {{ + notification.from.title || + notification.from.groupName || + notification.from.post.title | truncate(50) + }} @@ -132,11 +138,16 @@ export default { isComment(notificationSource) { return notificationSource.__typename === 'Comment' }, + isGroup(notificationSource) { + return notificationSource.__typename === 'Group' + }, params(notificationSource) { - const post = this.isComment(notificationSource) ? notificationSource.post : notificationSource + const target = this.isComment(notificationSource) + ? notificationSource.post + : notificationSource return { - id: post.id, - slug: post.slug, + id: target.id, + slug: target.slug, } }, hashParam(notificationSource) { diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 830b9efc7..b5651675e 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -645,7 +645,7 @@ }, "markAllAsRead": "Markiere alle als gelesen", "pageLink": "Alle Benachrichtigungen", - "post": "Beitrag", + "post": "Beitrag oder Gruppe", "reason": { "commented_on_post": "Hat Deinen Beitrag kommentiert …", "mentioned_in_comment": "Hat Dich in einem Kommentar erwähnt …", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 7e8e0bbaa..ff5be4470 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -645,7 +645,7 @@ }, "markAllAsRead": "Mark all as read", "pageLink": "All notifications", - "post": "Post", + "post": "Post or Group", "reason": { "commented_on_post": "Commented on your post …", "mentioned_in_comment": "Mentioned you in a comment …",