diff options
author | Vincent Petry <vincent@nextcloud.com> | 2020-11-25 19:36:17 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2020-11-26 10:47:56 +0300 |
commit | 699df4b260cc681b9d7c8bcb6406100575e48fc7 (patch) | |
tree | 142cd60d33152009feda1dd52b45e0c46e670ad0 /src | |
parent | c0cc183fc8aca0c50f3f30af491b60db391e6d78 (diff) |
Use isInCall mixins in NewGroupConversation
This also fixes a discrepancy in the participant method where the token
check was mistakenly inverted so that a dummy disconnected participant
would be returned despite being in a call.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue | 30 | ||||
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/Message.vue | 9 |
2 files changed, 12 insertions, 27 deletions
diff --git a/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue b/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue index 7ae17ad8f..745f1d743 100644 --- a/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue +++ b/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue @@ -133,7 +133,8 @@ import { } from '../../../services/conversationsService' import { generateUrl } from '@nextcloud/router' import PasswordProtect from './PasswordProtect/PasswordProtect' -import { PARTICIPANT } from '../../../constants' +import isInCall from '../../../mixins/isInCall' +import participant from '../../../mixins/participant' import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip' export default { @@ -154,6 +155,11 @@ export default { Plus, }, + mixins: [ + isInCall, + participant, + ], + data() { return { modal: false, @@ -187,28 +193,6 @@ export default { selectedParticipants() { return this.$store.getters.selectedParticipants }, - - participant() { - // TODO: use participant mixin ?? - if (this.$store.getters.getToken()) { - return { - inCall: PARTICIPANT.CALL_FLAG.DISCONNECTED, - } - } - - const participantIndex = this.$store.getters.getParticipantIndex(this.$store.getters.getToken(), this.$store.getters.getParticipantIdentifier()) - if (participantIndex !== -1) { - return this.$store.getters.getParticipant(this.$store.getters.getToken(), participantIndex) - } - - return { - inCall: PARTICIPANT.CALL_FLAG.DISCONNECTED, - } - }, - - isInCall() { - return this.participant.inCall !== PARTICIPANT.CALL_FLAG.DISCONNECTED - }, }, methods: { diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index db0663518..190ddb0cc 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -98,10 +98,6 @@ export default { tooltip: Tooltip, }, - mixins: [ - participant, - ], - components: { Actions, ActionButton, @@ -109,6 +105,11 @@ export default { Quote, RichText, }, + + mixins: [ + participant, + ], + inheritAttrs: false, props: { |