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/PublicShareSidebar.vue | |
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/PublicShareSidebar.vue')
-rw-r--r-- | src/PublicShareSidebar.vue | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/PublicShareSidebar.vue b/src/PublicShareSidebar.vue index 93293820a..2ac74f62d 100644 --- a/src/PublicShareSidebar.vue +++ b/src/PublicShareSidebar.vue @@ -49,7 +49,6 @@ import { loadState } from '@nextcloud/initial-state' import CallView from './components/CallView/CallView' import ChatView from './components/ChatView' import CallButton from './components/TopBar/CallButton' -import { PARTICIPANT } from './constants' import { EventBus } from './services/EventBus' import { fetchConversation } from './services/conversationsService' import { getPublicShareConversationData } from './services/filesIntegrationServices' @@ -61,6 +60,7 @@ import { signalingKill } from './utils/webrtc/index' import browserCheck from './mixins/browserCheck' import duplicateSessionHandler from './mixins/duplicateSessionHandler' import isInCall from './mixins/isInCall' +import participant from './mixins/participant' import talkHashCheck from './mixins/talkHashCheck' import '@nextcloud/dialogs/styles/toast.scss' @@ -79,6 +79,7 @@ export default { browserCheck, duplicateSessionHandler, isInCall, + participant, talkHashCheck, ], @@ -114,17 +115,6 @@ export default { return this.state.isOpen }, - participant() { - const participantIndex = this.$store.getters.getParticipantIndex(this.token, this.$store.getters.getParticipantIdentifier()) - if (participantIndex === -1) { - return { - inCall: PARTICIPANT.CALL_FLAG.DISCONNECTED, - } - } - - return this.$store.getters.getParticipant(this.token, participantIndex) - }, - warnLeaving() { return !this.isLeavingAfterSessionConflict && this.isInCall }, |