Fix MatrixClient access in settings

This commit is contained in:
Travis Ralston 2020-07-29 11:51:42 -06:00
parent 9c8682428f
commit ae3eb3da9c
2 changed files with 4 additions and 4 deletions

View file

@ -44,7 +44,7 @@ export default abstract class MatrixClientBackedSettingsHandler extends Settings
}
public get client(): MatrixClient {
return MatrixClientBackedSettingsHandler.matrixClient;
return MatrixClientBackedSettingsHandler._matrixClient;
}
protected initMatrixClient(oldClient: MatrixClient, newClient: MatrixClient) {

View file

@ -34,13 +34,13 @@ export default class RoomSettingsHandler extends MatrixClientBackedSettingsHandl
protected initMatrixClient(oldClient: MatrixClient, newClient: MatrixClient) {
if (oldClient) {
oldClient.removeListener("RoomState.events", this._onEvent);
oldClient.removeListener("RoomState.events", this.onEvent);
}
newClient.on("RoomState.events", this._onEvent);
newClient.on("RoomState.events", this.onEvent);
}
private _onEvent = (event: MatrixEvent, state: RoomState, prevEvent: MatrixEvent) => {
private onEvent = (event: MatrixEvent, state: RoomState, prevEvent: MatrixEvent) => {
const roomId = event.getRoomId();
const room = this.client.getRoom(roomId);