Browse Source

fix(conversations): do not add second participant to extended 1-1 twice

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
pull/14938/head
Maksim Sukharev 6 months ago
committed by backportbot[bot]
parent
commit
fbc561243c
  1. 5
      src/components/RightSidebar/Participants/ParticipantsTab.vue
  2. 3
      src/store/conversationsStore.js

5
src/components/RightSidebar/Participants/ParticipantsTab.vue

@ -332,7 +332,10 @@ export default {
if (this.isOneToOneConversation) {
await this.$store.dispatch('extendOneToOneConversation', {
token: this.token,
newParticipants: [participant],
newParticipants: [
{ id: this.conversation.name, source: ATTENDEE.ACTOR_TYPE.USERS, label: this.conversation.displayName },
participant,
],
})
} else {
await addParticipant(this.token, participant.id, participant.source)

3
src/store/conversationsStore.js

@ -1003,13 +1003,12 @@ const actions = {
* @param {object} context default store context
* @param {object} payload action payload
* @param {string} payload.token one-to-one conversation token
* @param {Array} payload.newParticipants selected participants to be added
* @param {Array} payload.newParticipants selected participants to be added (should include second participant form original conversation)
*/
async extendOneToOneConversation(context, { token, newParticipants }) {
const conversation = context.getters.conversation(token)
const participants = [
{ id: conversation.actorId, source: conversation.actorType, label: context.rootGetters.getDisplayName() },
{ id: conversation.name, source: ATTENDEE.ACTOR_TYPE.USERS, label: conversation.displayName },
...newParticipants,
]
const roomName = getDisplayNamesList(participants.map(participant => participant.label), CONVERSATION.MAX_NAME_LENGTH)

Loading…
Cancel
Save