Merge remote-tracking branch 'origin/develop' into 2-10-1-fixes
This commit is contained in:
commit
dcb7ed1b8c
428 changed files with 55612 additions and 18549 deletions
|
|
@ -9,30 +9,29 @@ import DialogModal from '../dialog_modal/dialog_modal.vue'
|
|||
*/
|
||||
const ConfirmModal = {
|
||||
components: {
|
||||
DialogModal
|
||||
DialogModal,
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
type: String
|
||||
type: String,
|
||||
},
|
||||
cancelText: {
|
||||
type: String
|
||||
type: String,
|
||||
},
|
||||
confirmText: {
|
||||
type: String
|
||||
}
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
emits: ['cancelled', 'accepted'],
|
||||
computed: {
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
onCancel () {
|
||||
onCancel() {
|
||||
this.$emit('cancelled')
|
||||
},
|
||||
onAccept () {
|
||||
onAccept() {
|
||||
this.$emit('accepted')
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default ConfirmModal
|
||||
|
|
|
|||
|
|
@ -1,64 +1,67 @@
|
|||
import { mapGetters } from 'vuex'
|
||||
|
||||
import ConfirmModal from './confirm_modal.vue'
|
||||
import Select from 'src/components/select/select.vue'
|
||||
import ConfirmModal from './confirm_modal.vue'
|
||||
|
||||
export default {
|
||||
props: ['type', 'user', 'status'],
|
||||
emits: ['hide', 'show', 'muted'],
|
||||
data: () => ({
|
||||
showing: false
|
||||
showing: false,
|
||||
}),
|
||||
components: {
|
||||
ConfirmModal,
|
||||
Select
|
||||
Select,
|
||||
},
|
||||
computed: {
|
||||
domain () {
|
||||
domain() {
|
||||
return this.user.fqn.split('@')[1]
|
||||
},
|
||||
keypath () {
|
||||
keypath() {
|
||||
if (this.type === 'domain') {
|
||||
return 'user_card.mute_domain_confirm'
|
||||
} else if (this.type === 'conversation') {
|
||||
return 'user_card.mute_conversation_confirm'
|
||||
}
|
||||
},
|
||||
conversationIsMuted () {
|
||||
conversationIsMuted() {
|
||||
return this.status.conversation_muted
|
||||
},
|
||||
domainIsMuted () {
|
||||
return new Set(this.$store.state.users.currentUser.domainMutes).has(this.domain)
|
||||
domainIsMuted() {
|
||||
return new Set(this.$store.state.users.currentUser.domainMutes).has(
|
||||
this.domain,
|
||||
)
|
||||
},
|
||||
shouldConfirm () {
|
||||
shouldConfirm() {
|
||||
switch (this.type) {
|
||||
case 'domain': {
|
||||
return this.mergedConfig.modalOnMuteDomain
|
||||
}
|
||||
default: { // conversation
|
||||
default: {
|
||||
// conversation
|
||||
return this.mergedConfig.modalOnMuteConversation
|
||||
}
|
||||
}
|
||||
},
|
||||
...mapGetters(['mergedConfig'])
|
||||
...mapGetters(['mergedConfig']),
|
||||
},
|
||||
methods: {
|
||||
optionallyPrompt () {
|
||||
optionallyPrompt() {
|
||||
if (this.shouldConfirm) {
|
||||
this.show()
|
||||
} else {
|
||||
this.doMute()
|
||||
}
|
||||
},
|
||||
show () {
|
||||
show() {
|
||||
this.showing = true
|
||||
this.$emit('show')
|
||||
},
|
||||
hide () {
|
||||
hide() {
|
||||
this.showing = false
|
||||
this.$emit('hide')
|
||||
},
|
||||
doMute () {
|
||||
doMute() {
|
||||
switch (this.type) {
|
||||
case 'domain': {
|
||||
if (!this.domainIsMuted) {
|
||||
|
|
@ -79,6 +82,6 @@ export default {
|
|||
}
|
||||
this.$emit('muted')
|
||||
this.hide()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue