Add confirmation for muting
This commit is contained in:
parent
60078ea734
commit
dba8dcc41a
2 changed files with 40 additions and 2 deletions
|
@ -6,6 +6,7 @@ import ModerationTools from '../moderation_tools/moderation_tools.vue'
|
||||||
import AccountActions from '../account_actions/account_actions.vue'
|
import AccountActions from '../account_actions/account_actions.vue'
|
||||||
import Select from '../select/select.vue'
|
import Select from '../select/select.vue'
|
||||||
import RichContent from 'src/components/rich_content/rich_content.jsx'
|
import RichContent from 'src/components/rich_content/rich_content.jsx'
|
||||||
|
import ConfirmModal from '../confirm_modal/confirm_modal.vue'
|
||||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
@ -32,7 +33,8 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
followRequestInProgress: false,
|
followRequestInProgress: false,
|
||||||
betterShadow: this.$store.state.interface.browserSupport.cssFilter
|
betterShadow: this.$store.state.interface.browserSupport.cssFilter,
|
||||||
|
showingConfirmMute: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
@ -113,6 +115,9 @@ export default {
|
||||||
hideFollowersCount () {
|
hideFollowersCount () {
|
||||||
return this.isOtherUser && this.user.hide_followers_count
|
return this.isOtherUser && this.user.hide_followers_count
|
||||||
},
|
},
|
||||||
|
shouldConfirmMute () {
|
||||||
|
return this.mergedConfig.modalOnMute
|
||||||
|
},
|
||||||
...mapGetters(['mergedConfig'])
|
...mapGetters(['mergedConfig'])
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -123,14 +128,29 @@ export default {
|
||||||
ProgressButton,
|
ProgressButton,
|
||||||
FollowButton,
|
FollowButton,
|
||||||
Select,
|
Select,
|
||||||
RichContent
|
RichContent,
|
||||||
|
ConfirmModal
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
refetchRelationship () {
|
refetchRelationship () {
|
||||||
return this.$store.dispatch('fetchUserRelationship', this.user.id)
|
return this.$store.dispatch('fetchUserRelationship', this.user.id)
|
||||||
},
|
},
|
||||||
|
showConfirmMute () {
|
||||||
|
this.showingConfirmMute = true
|
||||||
|
},
|
||||||
|
hideConfirmMute () {
|
||||||
|
this.showingConfirmMute = false
|
||||||
|
},
|
||||||
muteUser () {
|
muteUser () {
|
||||||
|
if (!this.shouldConfirmMute) {
|
||||||
|
this.doMuteUser()
|
||||||
|
} else {
|
||||||
|
this.showConfirmMute()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doMuteUser () {
|
||||||
this.$store.dispatch('muteUser', this.user.id)
|
this.$store.dispatch('muteUser', this.user.id)
|
||||||
|
this.hideConfirmMute()
|
||||||
},
|
},
|
||||||
unmuteUser () {
|
unmuteUser () {
|
||||||
this.$store.dispatch('unmuteUser', this.user.id)
|
this.$store.dispatch('unmuteUser', this.user.id)
|
||||||
|
|
|
@ -295,6 +295,24 @@
|
||||||
:handle-links="true"
|
:handle-links="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<confirm-modal
|
||||||
|
:showing="showingConfirmMute"
|
||||||
|
:title="$t('user_card.mute_confirm_title')"
|
||||||
|
:confirm-text="$t('user_card.mute_confirm_accept_button')"
|
||||||
|
:cancel-text="$t('user_card.mute_confirm_cancel_button')"
|
||||||
|
@accepted="doMuteUser"
|
||||||
|
@cancelled="hideConfirmMute"
|
||||||
|
>
|
||||||
|
<i18n
|
||||||
|
path="user_card.mute_confirm"
|
||||||
|
tag="span"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
place="user"
|
||||||
|
v-text="user.screen_name_ui"
|
||||||
|
/>
|
||||||
|
</i18n>
|
||||||
|
</confirm-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue