add options for marking single notification as read
This commit is contained in:
parent
c059f4a7ee
commit
ec2937ec1f
11 changed files with 85 additions and 4 deletions
|
|
@ -159,6 +159,26 @@ const Notifications = {
|
|||
updateScrollPosition () {
|
||||
this.showScrollTop = this.$refs.root.offsetTop < this.scrollerRef.scrollTop
|
||||
},
|
||||
notificationClicked (notification) {
|
||||
const { type, id, seen } = notification
|
||||
if (!seen) {
|
||||
switch (type) {
|
||||
case 'mention':
|
||||
case 'pleroma:report':
|
||||
case 'follow_request':
|
||||
break
|
||||
default:
|
||||
this.markOneAsSeen(id)
|
||||
}
|
||||
}
|
||||
},
|
||||
notificationInteracted (notification) {
|
||||
const { id, seen } = notification
|
||||
if (!seen) this.markOneAsSeen(id)
|
||||
},
|
||||
markOneAsSeen (id) {
|
||||
this.$store.dispatch('markSingleNotificationAsSeen', { id })
|
||||
},
|
||||
markAsSeen () {
|
||||
this.$store.dispatch('markNotificationsAsSeen')
|
||||
this.seenToDisplayCount = DEFAULT_SEEN_TO_DISPLAY_COUNT
|
||||
|
|
|
|||
|
|
@ -67,9 +67,13 @@
|
|||
role="listitem"
|
||||
class="notification"
|
||||
:class="{unseen: !minimalMode && !notification.seen}"
|
||||
@click="e => notificationClicked(notification)"
|
||||
>
|
||||
<div class="notification-overlay" />
|
||||
<notification :notification="notification" />
|
||||
<notification
|
||||
:notification="notification"
|
||||
@interacted="e => notificationInteracted(notification)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue