Ensure widgets are destroyed cleanly when minimized

Fixes https://github.com/vector-im/element-web/issues/15444 (an artifact of joining a call then minimizing the widget)

Also fixes other issues relating to widgets not loading when being minimized/maximized.
This commit is contained in:
Travis Ralston 2020-10-13 14:55:44 -06:00
parent 40038a6100
commit 294c35347c
3 changed files with 15 additions and 3 deletions

View file

@ -283,8 +283,8 @@ export class StopGapWidget extends EventEmitter {
}
}
public stop() {
if (ActiveWidgetStore.getPersistentWidgetId() === this.mockWidget.id) {
public stop(opts = {forceDestroy: false}) {
if (!opts?.forceDestroy && ActiveWidgetStore.getPersistentWidgetId() === this.mockWidget.id) {
console.log("Skipping destroy - persistent widget");
return;
}