Update src/stores/RoomViewStore.tsx
Co-authored-by: Florian D <florianduros@element.io>
This commit is contained in:
@@ -356,11 +356,9 @@ export class RoomViewStore extends EventEmitter {
|
|||||||
|
|
||||||
// Start a call if requested
|
// Start a call if requested
|
||||||
const currentRoomCall = this.state.roomId ? CallStore.instance.getCall(this.state.roomId) : null;
|
const currentRoomCall = this.state.roomId ? CallStore.instance.getCall(this.state.roomId) : null;
|
||||||
if (payload.view_call && room) {
|
if (payload.view_call && room && !currentRoomCall) {
|
||||||
if (!currentRoomCall) {
|
|
||||||
ElementCall.create(room, false);
|
ElementCall.create(room, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Destroy the call when leaving call view
|
// Destroy the call when leaving call view
|
||||||
const prevRoomCall = this.state.roomId ? CallStore.instance.getCall(this.state.roomId) : null;
|
const prevRoomCall = this.state.roomId ? CallStore.instance.getCall(this.state.roomId) : null;
|
||||||
if (prevRoomCall && !prevRoomCall.connected) {
|
if (prevRoomCall && !prevRoomCall.connected) {
|
||||||
|
|||||||
Reference in New Issue
Block a user