mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
Fix MatrixClient access in settings
This commit is contained in:
parent
9c8682428f
commit
ae3eb3da9c
@ -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) {
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user