aboutsummaryrefslogtreecommitdiff
path: root/src/components/account_actions/account_actions.js
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-02-09 16:26:30 -0500
committertusooa <tusooa@kazv.moe>2023-01-20 23:39:08 -0500
commit3b7aaae2b366abe1162c22a29918336c4210446f (patch)
tree6c71c19b7c6427fcc9c9d641f5e45399f2645bf0 /src/components/account_actions/account_actions.js
parentc032b48219ba601df5dabc7fd271444fe7db0321 (diff)
Add confirmation for blocking
Diffstat (limited to 'src/components/account_actions/account_actions.js')
-rw-r--r--src/components/account_actions/account_actions.js25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js
index c23407f9..7dec0c3d 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,23 @@ const AccountActions = {
'user', 'relationship'
],
data () {
- return { }
+ return {
+ showingConfirmBlock: false
+ }
},
components: {
ProgressButton,
Popover,
- UserListMenu
+ UserListMenu,
+ ConfirmModal
},
methods: {
+ showConfirmBlock () {
+ this.showingConfirmBlock = true
+ },
+ hideConfirmBlock () {
+ this.showingConfirmBlock = false
+ },
showRepeats () {
this.$store.dispatch('showReblogs', this.user.id)
},
@@ -31,7 +41,15 @@ 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)
@@ -50,6 +68,9 @@ const AccountActions = {
}
},
computed: {
+ shouldConfirmBlock () {
+ return this.$store.getters.mergedConfig.modalOnBlock
+ },
...mapState({
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
})