aboutsummaryrefslogtreecommitdiff
path: root/src/components/account_actions
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-09-27 18:47:50 -0400
committertusooa <tusooa@kazv.moe>2023-01-22 09:25:24 -0500
commitce8101e60a1dc1a768f793a34fb6e9cca70b4858 (patch)
treee52a0c0360dd9bf8ef04a63e7994216a73147027 /src/components/account_actions
parent5359633c743455739a8b6fe64e246c832656b4d0 (diff)
Add remove follower confirmation
Diffstat (limited to 'src/components/account_actions')
-rw-r--r--src/components/account_actions/account_actions.js20
-rw-r--r--src/components/account_actions/account_actions.vue21
2 files changed, 40 insertions, 1 deletions
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 @@
</i18n-t>
</confirm-modal>
</teleport>
+ <teleport to="#modal">
+ <confirm-modal
+ v-if="showingConfirmRemoveFollower"
+ :title="$t('user_card.remove_follower_confirm_title')"
+ :confirm-text="$t('user_card.remove_follower_confirm_accept_button')"
+ :cancel-text="$t('user_card.remove_follower_confirm_cancel_button')"
+ @accepted="doRemoveUserFromFollowers"
+ @cancelled="hideConfirmRemoveUserFromFollowers"
+ >
+ <i18n-t
+ keypath="user_card.remove_follower_confirm"
+ tag="span"
+ >
+ <template #user>
+ <span
+ v-text="user.screen_name_ui"
+ />
+ </template>
+ </i18n-t>
+ </confirm-modal>
+ </teleport>
</div>
</template>