diff options
author | Vincent Petry <pvince81@yahoo.fr> | 2020-11-25 19:09:10 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2020-11-25 19:29:30 +0300 |
commit | c0cc183fc8aca0c50f3f30af491b60db391e6d78 (patch) | |
tree | b765700dd60b1f0c8ec1fe6c9eed2f00f4e452c0 /src/views | |
parent | 59288cda483e623885ef1486d615bc323f1e0d10 (diff) |
Introduce participant mixin
To remove duplication of the "get current participant" logic all over
the place and also for future use.
Signed-off-by: Vincent Petry <pvince81@yahoo.fr>
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/MainView.vue | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/views/MainView.vue b/src/views/MainView.vue index b7652bf77..cb83bcfd6 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -23,6 +23,7 @@ import TopBar from '../components/TopBar/TopBar' import { PARTICIPANT } from '../constants' import isInLobby from '../mixins/isInLobby' import isInCall from '../mixins/isInCall' +import participant from '../mixins/participant' export default { name: 'MainView', @@ -36,6 +37,7 @@ export default { mixins: [ isInLobby, isInCall, + participant, ], props: { @@ -50,23 +52,6 @@ export default { return this.$store.getters.conversation(this.token) }, - participant() { - if (typeof this.token === 'undefined') { - return { - inCall: PARTICIPANT.CALL_FLAG.DISCONNECTED, - } - } - - const participantIndex = this.$store.getters.getParticipantIndex(this.token, this.$store.getters.getParticipantIdentifier()) - if (participantIndex !== -1) { - return this.$store.getters.getParticipant(this.token, participantIndex) - } - - return { - inCall: PARTICIPANT.CALL_FLAG.DISCONNECTED, - } - }, - showChatInSidebar() { return this.isInCall }, |