Skip to content

Commit

Permalink
fix(Participant): reset initial state of component if reused
Browse files Browse the repository at this point in the history
- Recycle scroller is keeping items in the poll, which may differ and interfere with actual list of participants. Removed user from the list may be replaced by any other user from poll (usually first in the list) with open dialog and possibility to remove self

Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Feb 25, 2025
1 parent a54adbf commit 8f2e2fd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/RightSidebar/Participants/Participant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@
</template>

<template #extra>
<ParticipantPermissionsEditor v-if="permissionsEditor"
<ParticipantPermissionsEditor v-if="showPermissionsOptions && permissionsEditor"
:actor-id="participant.actorId"
close-after-click
:participant="participant"
:token="token"
@close="permissionsEditor = false" />

<!-- Confirmation required to remove participant -->
<NcDialog v-if="isRemoveDialogOpen"
<NcDialog v-if="canBeModerated && isRemoveDialogOpen"
:open.sync="isRemoveDialogOpen"
:name="removeParticipantLabel">
<p> {{ removeDialogMessage }} </p>
Expand Down Expand Up @@ -788,7 +788,16 @@ export default {
if (!value || !(value === 'ringing' || value === 'accepted')) {
this.disabled = false
}
}
},

participantNavigationId() {
// FIXME: as RecycleScroller reuses item components, we need to reset the state,
// if participant object has been replaced by another one
this.permissionsEditor = false
this.isRemoveDialogOpen = false
this.isBanParticipant = false
this.internalNote = ''
},
},

methods: {
Expand Down

0 comments on commit 8f2e2fd

Please sign in to comment.