Improve typing around event emitter handlers (#7816)
This commit is contained in:
parent
213b32bf14
commit
7fa01ffb06
79 changed files with 548 additions and 471 deletions
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
import React from 'react';
|
||||
import { GuestAccess, HistoryVisibility, JoinRule, RestrictedAllowType } from "matrix-js-sdk/src/@types/partials";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
|
||||
import { EventType } from 'matrix-js-sdk/src/@types/event';
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
|
@ -71,7 +72,7 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||
// TODO: [REACT-WARNING] Move this to constructor
|
||||
UNSAFE_componentWillMount() { // eslint-disable-line
|
||||
const cli = MatrixClientPeg.get();
|
||||
cli.on("RoomState.events", this.onStateEvent);
|
||||
cli.on(RoomStateEvent.Events, this.onStateEvent);
|
||||
|
||||
const room = cli.getRoom(this.props.roomId);
|
||||
const state = room.currentState;
|
||||
|
@ -110,7 +111,7 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
MatrixClientPeg.get().removeListener("RoomState.events", this.onStateEvent);
|
||||
MatrixClientPeg.get().removeListener(RoomStateEvent.Events, this.onStateEvent);
|
||||
}
|
||||
|
||||
private onStateEvent = (e: MatrixEvent) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue