Merge pull request #2156 from h3poteto/use_notification_type

Use NotificationType of megalodon to handle notifications
This commit is contained in:
AkiraFukushima 2021-02-17 01:02:00 +09:00 committed by GitHub
commit cca28c1b4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
import generator, { Entity } from 'megalodon'
import generator, { Entity, NotificationType } from 'megalodon'
import { Module, MutationTree, ActionTree, GetterTree } from 'vuex'
import { RootState } from '@/store'
import { MyWindow } from '~/src/types/global'
@ -148,12 +148,13 @@ const getters: GetterTree<NotificationsState, RootState> = {
handledNotifications: state => {
return state.notifications.filter(n => {
switch (n.type) {
case 'favourite':
case 'follow':
case 'follow_request':
case 'mention':
case 'reblog':
case 'emoji_reaction':
case NotificationType.Follow:
case NotificationType.Favourite:
case NotificationType.Reblog:
case NotificationType.Mention:
case NotificationType.Poll:
case NotificationType.EmojiReaction:
case NotificationType.FollowRequest:
return true
default:
return false