[FIX] mail: prevents shared rtcSession focus across callViews

After https://github.com/odoo/odoo/pull/78439 and before this commit,
the `activeRtcSession` was a field of `callView` which is the same view
for all channels. Which means that setting an `activeRtcSession` would
display it for any channel instead of only the channel that hosted this
session.

This commit fixes this issue by moving the field to the `Channel` model.

closes odoo/odoo#99270

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Thanh Dodeur
2022-08-31 12:38:05 +02:00
parent 80d85edb1a
commit a8d7887f34
4 changed files with 7 additions and 4 deletions
@@ -26,9 +26,9 @@ registerModel({
}
if (this.rtcSession) {
if (this.callView.activeRtcSession === this.rtcSession && this.mainViewTileOwner) {
this.callView.update({ activeRtcSession: clear() });
this.callView.channel.update({ activeRtcSession: clear() });
} else {
this.callView.update({ activeRtcSession: this.rtcSession });
this.callView.channel.update({ activeRtcSession: this.rtcSession });
}
return;
}
@@ -57,7 +57,7 @@ registerModel({
}
const activeRtcSession = this.callView.activeRtcSession;
if (showOnlyVideo && activeRtcSession && !activeRtcSession.videoStream) {
this.callView.update({ activeRtcSession: clear() });
this.callView.channel.update({ activeRtcSession: clear() });
}
},
onClickRegisterKeyButton() {
+3 -1
View File
@@ -158,7 +158,9 @@ registerModel({
/**
* The rtc session that is the main card of the view.
*/
activeRtcSession: one('RtcSession'),
activeRtcSession: one('RtcSession', {
related: 'channel.activeRtcSession',
}),
/**
* The aspect ratio of the tiles.
*/
+1
View File
@@ -192,6 +192,7 @@ registerModel({
},
},
fields: {
activeRtcSession: one('RtcSession'),
areAllMembersLoaded: attr({
compute: '_computeAreAllMembersLoaded',
}),