diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-05-04 11:05:05 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-05-04 11:05:05 +0300 |
| commit | 101eebb40be4dd87df83247e9db655c3cb135f48 (patch) | |
| tree | 043b1c06a078d0b845bc036a87165ac2568391b2 /src/components/notification/notification.js | |
| parent | 39e3917118293912b2af09f509457d718f0207c9 (diff) | |
| parent | 9b349b40196778abe1a2cdb1d241d4c9572d305c (diff) | |
Merge branch 'develop' into fix/signup-without-email
Diffstat (limited to 'src/components/notification/notification.js')
| -rw-r--r-- | src/components/notification/notification.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index e7bd769e..1ae81ce4 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -2,6 +2,7 @@ import Status from '../status/status.vue' import UserAvatar from '../user_avatar/user_avatar.vue' import UserCard from '../user_card/user_card.vue' import Timeago from '../timeago/timeago.vue' +import { isStatusNotification } from '../../services/notification_utils/notification_utils.js' import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' @@ -32,6 +33,24 @@ const Notification = { }, toggleMute () { this.unmuted = !this.unmuted + }, + approveUser () { + this.$store.state.api.backendInteractor.approveUser({ id: this.user.id }) + this.$store.dispatch('removeFollowRequest', this.user) + this.$store.dispatch('markSingleNotificationAsSeen', { id: this.notification.id }) + this.$store.dispatch('updateNotification', { + id: this.notification.id, + updater: notification => { + notification.type = 'follow' + } + }) + }, + denyUser () { + this.$store.state.api.backendInteractor.denyUser({ id: this.user.id }) + .then(() => { + this.$store.dispatch('dismissNotificationLocal', { id: this.notification.id }) + this.$store.dispatch('removeFollowRequest', this.user) + }) } }, computed: { @@ -57,6 +76,9 @@ const Notification = { }, needMute () { return this.user.muted + }, + isStatusNotification () { + return isStatusNotification(this.notification.type) } } } |
