Add remove follower confirmation

This commit is contained in:
Tusooa Zhu 2022-09-27 18:47:50 -04:00 committed by tusooa
commit ce8101e60a
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
9 changed files with 99 additions and 3 deletions

View file

@ -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
})