Browse Source

Merge pull request #6342 from nextcloud/bugfix/noid/reuse-participant-information-if-we-have-a-userid

Reuse the participant information if we have a userId
pull/6347/head
Marco 4 years ago
committed by GitHub
parent
commit
c8a42e78a8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/components/CallView/shared/Video.vue
  2. 16
      src/store/participantsStore.js

2
src/components/CallView/shared/Video.vue

@ -224,7 +224,7 @@ export default {
},
peerData() {
let peerData = this.$store.getters.getPeer(this.$store.getters.getToken(), this.peerId)
let peerData = this.$store.getters.getPeer(this.$store.getters.getToken(), this.peerId, this.model.attributes.userId)
if (!peerData.actorId) {
EventBus.$emit('refresh-peer-list')
peerData = {

16
src/store/participantsStore.js

@ -94,13 +94,19 @@ const getters = {
return index
},
getPeer: (state) => (token, sessionId) => {
if (!state.peers[token]) {
return {}
getPeer: (state) => (token, sessionId, userId) => {
if (state.peers[token]) {
if (Object.prototype.hasOwnProperty.call(state.peers[token], sessionId)) {
return state.peers[token][sessionId]
}
}
if (Object.prototype.hasOwnProperty.call(state.peers[token], sessionId)) {
return state.peers[token][sessionId]
// Fallback to the participant list, if we have a user id that should be easy
if (state.participants[token] && userId) {
const index = state.participants[token].findIndex(participant => participant.actorId === userId && participant.actorType === 'users')
if (index !== -1) {
return state.participants[token][index]
}
}
return {}

Loading…
Cancel
Save