Use NotificationType of megalodon to handle notifications

This commit is contained in:
AkiraFukushima 2021-02-17 00:48:14 +09:00
parent 9466e4934c
commit 98b555b285
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 { Module, MutationTree, ActionTree, GetterTree } from 'vuex'
import { RootState } from '@/store' import { RootState } from '@/store'
import { MyWindow } from '~/src/types/global' import { MyWindow } from '~/src/types/global'
@ -148,12 +148,13 @@ const getters: GetterTree<NotificationsState, RootState> = {
handledNotifications: state => { handledNotifications: state => {
return state.notifications.filter(n => { return state.notifications.filter(n => {
switch (n.type) { switch (n.type) {
case 'favourite': case NotificationType.Follow:
case 'follow': case NotificationType.Favourite:
case 'follow_request': case NotificationType.Reblog:
case 'mention': case NotificationType.Mention:
case 'reblog': case NotificationType.Poll:
case 'emoji_reaction': case NotificationType.EmojiReaction:
case NotificationType.FollowRequest:
return true return true
default: default:
return false return false