Properly handle persistent widgets when room is left (#7724)

This commit is contained in:
Michael Telatynski
2022-02-07 14:40:22 +00:00
committed by GitHub
parent d72469663d
commit ec92102fe3
4 changed files with 130 additions and 103 deletions

View File

@@ -64,9 +64,8 @@ import { arrayFastClone } from "../../utils/arrays";
interface IAppTileProps {
// Note: these are only the props we care about
app: IWidget;
room: Room;
room?: Room; // without a room it is a user widget
userId: string;
creatorUserId: string;
waitForIframeLoad: boolean;
@@ -423,6 +422,7 @@ export class StopGapWidget extends EventEmitter {
if (!this.started) return;
WidgetMessagingStore.instance.stopMessaging(this.mockWidget);
ActiveWidgetStore.instance.delRoomId(this.mockWidget.id);
this.messaging = null;
if (MatrixClientPeg.get()) {
MatrixClientPeg.get().off('event', this.onEvent);