Merge pull request #6608 from matrix-org/dbkr/kill_persistent_jitsi
Fix video call persisting when widget removed
This commit is contained in:
commit
ecb2d9908d
1 changed files with 14 additions and 0 deletions
|
@ -137,6 +137,20 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
|
||||||
if (edited && !this.roomMap.has(room.roomId)) {
|
if (edited && !this.roomMap.has(room.roomId)) {
|
||||||
this.roomMap.set(room.roomId, roomInfo);
|
this.roomMap.set(room.roomId, roomInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If a persistent widget is active, check to see if it's just been removed.
|
||||||
|
// If it has, it needs to destroyed otherwise unmounting the node won't kill it
|
||||||
|
const persistentWidgetId = ActiveWidgetStore.getPersistentWidgetId();
|
||||||
|
if (persistentWidgetId) {
|
||||||
|
if (
|
||||||
|
ActiveWidgetStore.getRoomId(persistentWidgetId) === room.roomId &&
|
||||||
|
!roomInfo.widgets.some(w => w.id === persistentWidgetId)
|
||||||
|
) {
|
||||||
|
console.log(`Persistent widget ${persistentWidgetId} removed from room ${room.roomId}: destroying.`);
|
||||||
|
ActiveWidgetStore.destroyPersistentWidget(persistentWidgetId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.emit(room.roomId);
|
this.emit(room.roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue