aboutsummaryrefslogtreecommitdiff
path: root/src/components/account_actions/account_actions.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2023-10-29 16:26:05 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2023-10-29 16:26:05 +0000
commitb6accf9e7f7ef5f23cbf8bac57e54cefa0db4620 (patch)
tree91d6db4e663dfa8f94991032220fd415a5612d17 /src/components/account_actions/account_actions.js
parent321a131c20d83b0a7061c2b4600c4d77dec5b7fe (diff)
parentf685f9021bfaff71616efd8e83d114441e69701b (diff)
Merge branch 'develop' into 'master'
Update master branch See merge request pleroma/pleroma-fe!1861
Diffstat (limited to 'src/components/account_actions/account_actions.js')
-rw-r--r--src/components/account_actions/account_actions.js43
1 files changed, 41 insertions, 2 deletions
diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js
index c23407f9..acd93e06 100644
--- a/src/components/account_actions/account_actions.js
+++ b/src/components/account_actions/account_actions.js
@@ -2,6 +2,7 @@ import { mapState } from 'vuex'
import ProgressButton from '../progress_button/progress_button.vue'
import Popover from '../popover/popover.vue'
import UserListMenu from 'src/components/user_list_menu/user_list_menu.vue'
+import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faEllipsisV
@@ -16,14 +17,30 @@ const AccountActions = {
'user', 'relationship'
],
data () {
- return { }
+ return {
+ showingConfirmBlock: false,
+ showingConfirmRemoveFollower: false
+ }
},
components: {
ProgressButton,
Popover,
- UserListMenu
+ UserListMenu,
+ ConfirmModal
},
methods: {
+ showConfirmBlock () {
+ this.showingConfirmBlock = true
+ },
+ hideConfirmBlock () {
+ this.showingConfirmBlock = false
+ },
+ showConfirmRemoveUserFromFollowers () {
+ this.showingConfirmRemoveFollower = true
+ },
+ hideConfirmRemoveUserFromFollowers () {
+ this.showingConfirmRemoveFollower = false
+ },
showRepeats () {
this.$store.dispatch('showReblogs', this.user.id)
},
@@ -31,13 +48,29 @@ const AccountActions = {
this.$store.dispatch('hideReblogs', this.user.id)
},
blockUser () {
+ if (!this.shouldConfirmBlock) {
+ this.doBlockUser()
+ } else {
+ this.showConfirmBlock()
+ }
+ },
+ doBlockUser () {
this.$store.dispatch('blockUser', this.user.id)
+ this.hideConfirmBlock()
},
unblockUser () {
this.$store.dispatch('unblockUser', this.user.id)
},
removeUserFromFollowers () {
+ if (!this.shouldConfirmRemoveUserFromFollowers) {
+ this.doRemoveUserFromFollowers()
+ } else {
+ this.showConfirmRemoveUserFromFollowers()
+ }
+ },
+ doRemoveUserFromFollowers () {
this.$store.dispatch('removeUserFromFollowers', this.user.id)
+ this.hideConfirmRemoveUserFromFollowers()
},
reportUser () {
this.$store.dispatch('openUserReportingModal', { userId: this.user.id })
@@ -50,6 +83,12 @@ const AccountActions = {
}
},
computed: {
+ shouldConfirmBlock () {
+ return this.$store.getters.mergedConfig.modalOnBlock
+ },
+ shouldConfirmRemoveUserFromFollowers () {
+ return this.$store.getters.mergedConfig.modalOnRemoveUserFromFollowers
+ },
...mapState({
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
})