From 3b7aaae2b366abe1162c22a29918336c4210446f Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 9 Feb 2022 16:26:30 -0500 Subject: Add confirmation for blocking --- src/components/account_actions/account_actions.js | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/components/account_actions/account_actions.js') 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 }) -- cgit v1.2.3-70-g09d2 From ce8101e60a1dc1a768f793a34fb6e9cca70b4858 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 27 Sep 2022 18:47:50 -0400 Subject: Add remove follower confirmation --- src/components/account_actions/account_actions.js | 20 +++++++++++++++- src/components/account_actions/account_actions.vue | 21 +++++++++++++++++ src/components/follow_card/follow_card.vue | 1 + .../remove_follower_button.js | 27 ++++++++++++++++++++-- .../remove_follower_button.vue | 21 +++++++++++++++++ src/components/settings_modal/tabs/general_tab.vue | 5 ++++ src/i18n/en.json | 5 ++++ src/modules/config.js | 1 + src/modules/instance.js | 1 + 9 files changed, 99 insertions(+), 3 deletions(-) (limited to 'src/components/account_actions/account_actions.js') diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 7dec0c3d..acd93e06 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -18,7 +18,8 @@ const AccountActions = { ], data () { return { - showingConfirmBlock: false + showingConfirmBlock: false, + showingConfirmRemoveFollower: false } }, components: { @@ -34,6 +35,12 @@ const AccountActions = { hideConfirmBlock () { this.showingConfirmBlock = false }, + showConfirmRemoveUserFromFollowers () { + this.showingConfirmRemoveFollower = true + }, + hideConfirmRemoveUserFromFollowers () { + this.showingConfirmRemoveFollower = false + }, showRepeats () { this.$store.dispatch('showReblogs', this.user.id) }, @@ -55,7 +62,15 @@ const AccountActions = { 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 }) @@ -71,6 +86,9 @@ const AccountActions = { shouldConfirmBlock () { return this.$store.getters.mergedConfig.modalOnBlock }, + shouldConfirmRemoveUserFromFollowers () { + return this.$store.getters.mergedConfig.modalOnRemoveUserFromFollowers + }, ...mapState({ pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable }) diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index 161bab09..ce19291a 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -95,6 +95,27 @@ + + + + + + + diff --git a/src/components/follow_card/follow_card.vue b/src/components/follow_card/follow_card.vue index eff69fb2..bdb6b809 100644 --- a/src/components/follow_card/follow_card.vue +++ b/src/components/follow_card/follow_card.vue @@ -24,6 +24,7 @@ />