Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(ParticipantsList): Update list when needed #10843

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/components/RightSidebar/Participants/ParticipantsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import ParticipantsListVirtual from './ParticipantsList/ParticipantsListVirtual.
import ParticipantsSearchResults from './ParticipantsSearchResults/ParticipantsSearchResults.vue'

import { useSortParticipants } from '../../../composables/useSortParticipants.js'
import { useIsInCall } from '../../../composables/useIsInCall.js'
import getParticipants from '../../../mixins/getParticipants.js'
import { searchPossibleConversations } from '../../../services/conversationsService.js'
import { EventBus } from '../../../services/EventBus.js'
Expand Down Expand Up @@ -122,9 +123,11 @@ export default {

setup() {
const { sortParticipants } = useSortParticipants()
const isInCall = useIsInCall()

return {
sortParticipants,
isInCall,
}
},

Expand Down Expand Up @@ -185,6 +188,12 @@ export default {
watch: {
searchText(value) {
this.isFocused = !!value
},

isActive(value) {
if (value && this.pendingChanges) {
this.debounceUpdateParticipants()
}
}
},

Expand Down
7 changes: 5 additions & 2 deletions src/mixins/getParticipants.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const getParticipants = {
return {
participantsInitialised: false,
fetchingParticipants: false,
pendingChanges: false,
}
},

Expand Down Expand Up @@ -79,7 +80,9 @@ const getParticipants = {
},

debounceUpdateParticipants() {
if (!this.isActive) {
if (!this.isActive && !this.isInCall) {
DorraJaouad marked this conversation as resolved.
Show resolved Hide resolved
// Update is ignored but there is a flag to force the participants update
this.pendingChanges = true
return
}

Expand All @@ -88,7 +91,7 @@ const getParticipants = {
} else {
this.debounceSlowUpdateParticipants()
}

this.pendingChanges = false
},

debounceSlowUpdateParticipants: debounce(function() {
Expand Down