Skip to content

Commit

Permalink
[wip] fixme: speaking and screen update watchers are not working
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Jun 5, 2024
1 parent c8eecfc commit 6015ef3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,16 @@ export default {
},

screens() {
console.log('screens watcher')

Check failure on line 379 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected console statement
this._setScreenVisible()

},
// screens: {
// deep: true,

Check failure on line 384 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected tab character
// handler() {

Check failure on line 385 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected tab character
// this._setScreenVisible()

Check failure on line 386 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected tab character
// }

Check failure on line 387 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected tab character
// },

callParticipantModelsWithScreen(newValue, previousValue) {
// Everytime a new screen is shared, switch to promoted view
Expand Down Expand Up @@ -455,6 +462,7 @@ export default {
* @param {Array} models the array of CallParticipantModels
*/
updateDataFromCallParticipantModels(models) {
console.log('updateDataFromCallParticipantModels', models)

Check failure on line 465 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected console statement
const addedModels = models.filter(model => !this.sharedDatas[model.attributes.peerId])
const removedModelIds = Object.keys(this.sharedDatas).filter(sharedDataId => models.find(model => model.attributes.peerId === sharedDataId) === undefined)

Expand All @@ -464,15 +472,15 @@ export default {
delete this.sharedDatas[removedModelId]

this.speakingUnwatchers[removedModelId]()
// Not reactive, but not a problem
// FIXME Not reactive, but not a problem?
delete this.speakingUnwatchers[removedModelId]

this.screenUnwatchers[removedModelId]()
// Not reactive, but not a problem
// FIXME Not reactive, but not a problem?
delete this.screenUnwatchers[removedModelId]

this.raisedHandUnwatchers[removedModelId]()
// Not reactive, but not a problem
// FIXME Not reactive, but not a problem?
delete this.raisedHandUnwatchers[removedModelId]

const index = this.speakers.findIndex(speaker => speaker.id === removedModelId)
Expand All @@ -490,7 +498,7 @@ export default {

this.sharedDatas[addedModel.attributes.peerId] = sharedData

// Not reactive, but not a problem
// FIXME Not reactive, but not a problem?
this.speakingUnwatchers[addedModel.attributes.peerId] = this.$watch(function() {
return addedModel.attributes.speaking
}, function(speaking) {
Expand All @@ -502,14 +510,14 @@ export default {
active: false,
})

// Not reactive, but not a problem
// FIXME Not reactive, but not a problem?
this.screenUnwatchers[addedModel.attributes.peerId] = this.$watch(function() {
return addedModel.attributes.screen
}, function(screen) {
this._setScreenAvailable(addedModel.attributes.peerId, screen)
})

// Not reactive, but not a problem
// FIXME Not reactive, but not a problem? - at least works
this.raisedHandUnwatchers[addedModel.attributes.peerId] = this.$watch(function() {
return addedModel.attributes.raisedHand
}, function(raisedHand) {
Expand Down Expand Up @@ -578,6 +586,7 @@ export default {
},

_setScreenAvailable(id, screen) {
console.log('_setScreenAvailable', id, screen)

Check failure on line 589 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected console statement
if (screen) {
this.screens.unshift(id)

Expand Down Expand Up @@ -625,6 +634,7 @@ export default {
},

_setScreenVisible() {
console.log('_setScreenVisible', this.sharedDatas)

Check failure on line 637 in src/components/CallView/CallView.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected console statement
this.localSharedData.screenVisible = false

Object.values(this.sharedDatas).forEach(sharedData => {
Expand Down

0 comments on commit 6015ef3

Please sign in to comment.