related user for group notifications

This commit is contained in:
Moriz Wahl 2023-03-15 17:49:52 +01:00
parent 997dff4dec
commit ab58c569d0
3 changed files with 7 additions and 7 deletions

View File

@ -1,12 +1,12 @@
<template>
<article :class="{ '--read': notification.read, notification: true }">
<client-only>
<user-teaser :user="isGroup ? to : from.author" :date-time="from.createdAt" />
<user-teaser :user="isGroup ? notification.relatedUser : from.author" :date-time="from.createdAt" />
</client-only>
<p class="description">{{ $t(`notifications.reason.${notification.reason}`) }}</p>
<nuxt-link
class="link"
:to="{ name: isGroup ? 'group' : 'post-id-slug', params, hashParam }"
:to="{ name: isGroup ? 'group-id-slug' : 'post-id-slug', params, hashParam }"
@click.native="$emit('read')"
>
<base-card wideContent>
@ -38,9 +38,6 @@ export default {
from() {
return this.notification.from
},
to() {
return this.notification.to
},
isComment() {
return this.from.__typename === 'Comment'
},

View File

@ -40,7 +40,7 @@
<client-only>
<user-teaser
:user="
isGroup(notification.from) ? notification.to : notification.from.author
isGroup(notification.from) ? notification.relatedUser : notification.from.author
"
:date-time="notification.from.createdAt"
:class="{ 'notification-status': notification.read }"
@ -63,7 +63,7 @@
class="notification-mention-post"
:class="{ 'notification-status': notification.read }"
:to="{
name: isGroup(notification.from) ? 'group' : 'post-id-slug',
name: isGroup(notification.from) ? 'group-id-slug' : 'post-id-slug',
params: params(notification.from),
hash: hashParam(notification.from),
}"

View File

@ -150,6 +150,9 @@ export const notificationQuery = (_i18n) => {
...group
}
}
relatedUser {
...user
}
}
}
`