mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
fix(ReactionToaster): immediately connect all models in the call when joining
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
130eb1ac69
commit
8ebca98387
1 changed files with 17 additions and 13 deletions
|
|
@ -113,20 +113,24 @@ export default {
|
|||
},
|
||||
|
||||
watch: {
|
||||
callParticipantModels(models) {
|
||||
// subscribe connected models for reaction signals
|
||||
const addedModels = models.filter((model) => !this.registeredModels[model.attributes.peerId])
|
||||
addedModels.forEach((addedModel) => {
|
||||
this.registeredModels[addedModel.attributes.peerId] = addedModel
|
||||
this.registeredModels[addedModel.attributes.peerId].on('reaction', this.handleReaction)
|
||||
})
|
||||
callParticipantModels: {
|
||||
handler(models) {
|
||||
// subscribe connected models for reaction signals
|
||||
const addedModels = models.filter((model) => !this.registeredModels[model.attributes.peerId])
|
||||
addedModels.forEach((addedModel) => {
|
||||
this.registeredModels[addedModel.attributes.peerId] = addedModel
|
||||
this.registeredModels[addedModel.attributes.peerId].on('reaction', this.handleReaction)
|
||||
})
|
||||
|
||||
// unsubscribe disconnected models
|
||||
const removedModelIds = Object.keys(this.registeredModels).filter((registeredModelId) => !models.find((model) => model.attributes.peerId === registeredModelId))
|
||||
removedModelIds.forEach((removedModelId) => {
|
||||
this.registeredModels[removedModelId].off('reaction', this.handleReaction)
|
||||
delete this.registeredModels[removedModelId]
|
||||
})
|
||||
// unsubscribe disconnected models
|
||||
const removedModelIds = Object.keys(this.registeredModels).filter((registeredModelId) => !models.find((model) => model.attributes.peerId === registeredModelId))
|
||||
removedModelIds.forEach((removedModelId) => {
|
||||
this.registeredModels[removedModelId].off('reaction', this.handleReaction)
|
||||
delete this.registeredModels[removedModelId]
|
||||
})
|
||||
},
|
||||
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue