Tear down AppTile using lifecycle tracking (#7833)

This commit is contained in:
J. Ryan Stinnett
2022-02-17 16:30:36 +00:00
committed by GitHub
parent f697301298
commit a939184e10
8 changed files with 295 additions and 79 deletions
+2 -3
View File
@@ -31,7 +31,6 @@ import {
convertToStorePanel,
IRightPanelForRoom,
} from './RightPanelStoreIPanelState';
import { MatrixClientPeg } from "../../MatrixClientPeg";
import RoomViewStore from '../RoomViewStore';
const GROUP_PHASES = [
@@ -71,7 +70,7 @@ export default class RightPanelStore extends ReadyWatchingStore {
protected async onReady(): Promise<any> {
this.isReady = true;
this.roomStoreToken = RoomViewStore.addListener(this.onRoomViewStoreUpdate);
MatrixClientPeg.get().on("crypto.verification.request", this.onVerificationRequestUpdate);
this.matrixClient.on("crypto.verification.request", this.onVerificationRequestUpdate);
this.viewedRoomId = RoomViewStore.getRoomId();
this.loadCacheFromSettings();
this.emitAndUpdateSettings();
@@ -85,7 +84,7 @@ export default class RightPanelStore extends ReadyWatchingStore {
protected async onNotReady(): Promise<any> {
this.isReady = false;
MatrixClientPeg.get().off("crypto.verification.request", this.onVerificationRequestUpdate);
this.matrixClient.off("crypto.verification.request", this.onVerificationRequestUpdate);
this.roomStoreToken.remove();
}