aboutsummaryrefslogtreecommitdiff
path: root/src/components/notification/notification.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2020-05-02 14:17:27 +0000
committerShpuld Shpludson <shp@cock.li>2020-05-02 14:17:27 +0000
commita0f780c4550b77d4574e0de8932a2dff288784a3 (patch)
tree63be5e8364a2e86ab778749c7ee4b880fd2420f3 /src/components/notification/notification.js
parent8e049297ff6a125298ba9d06a3a4a563b231360f (diff)
parent2618c1b702d1881970cd1ee1109c421b24f2229e (diff)
Merge branch 'rc/2.0.3' into 'master'
Update MASTER with 2.0.3 for real See merge request pleroma/pleroma-fe!1099
Diffstat (limited to 'src/components/notification/notification.js')
-rw-r--r--src/components/notification/notification.js22
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)
}
}
}