Skip to content

Commit

Permalink
Merge pull request #10843 from nextcloud/fix/10677/participants-list-…
Browse files Browse the repository at this point in the history
…update

Fix(ParticipantsList): Update list when needed
  • Loading branch information
DorraJaouad authored Nov 8, 2023
2 parents 0fb10d1 + eaa0091 commit dbbf34e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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) {
// 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

0 comments on commit dbbf34e

Please sign in to comment.