diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-05-01 20:24:25 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-05-01 20:24:25 +0000 |
| commit | c67e9daf068c5a7eafaa7ce6a6418c8916a4f118 (patch) | |
| tree | 8b6d1b006c7d3e74a5e5b3515f1a55a99aaa4b21 /src/components/notification/notification.js | |
| parent | af3e69743e3192898f185fbc867defa1d155a4d4 (diff) | |
| parent | 01b07f01e9340935faf51e5a3c8034cc90423989 (diff) | |
Merge branch 'follow-request-notification' into 'develop'
Add support for follow request notifications
Closes #823 and #822
See merge request pleroma/pleroma-fe!1093
Diffstat (limited to 'src/components/notification/notification.js')
| -rw-r--r-- | src/components/notification/notification.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index e7bd769e..6deee7d5 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,21 @@ 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('updateNotification', { + id: this.notification.id, + updater: notification => { + notification.type = 'follow' + } + }) + }, + denyUser () { + this.$store.state.api.backendInteractor.denyUser({ id: this.user.id }) + this.$store.dispatch('removeFollowRequest', this.user) + this.$store.dispatch('dismissNotification', { id: this.notification.id }) } }, computed: { @@ -57,6 +73,9 @@ const Notification = { }, needMute () { return this.user.muted + }, + isStatusNotification () { + return isStatusNotification(this.notification.type) } } } |
