Enable @typescript-eslint/explicit-member-accessibility on /src (#9785)

* Enable `@typescript-eslint/explicit-member-accessibility` on /src

* Prettier
This commit is contained in:
Michael Telatynski 2022-12-16 12:29:59 +00:00 committed by GitHub
parent 51554399fb
commit f1e8e7f140
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
396 changed files with 1110 additions and 1098 deletions

View file

@ -61,7 +61,7 @@ export default class AppsDrawer extends React.Component<IProps, IState> {
showApps: true,
};
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -50,14 +50,14 @@ interface IState {
}
export default class Autocomplete extends React.PureComponent<IProps, IState> {
autocompleter: Autocompleter;
queryRequested: string;
debounceCompletionsRequest: number;
public autocompleter: Autocompleter;
public queryRequested: string;
public debounceCompletionsRequest: number;
private containerRef = createRef<HTMLDivElement>();
public static contextType = RoomContext;
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -79,7 +79,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
};
}
componentDidMount() {
public componentDidMount() {
this.autocompleter = new Autocompleter(this.props.room, this.context.timelineRenderingType);
this.applyNewProps();
}
@ -98,7 +98,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
this.complete(this.props.query, this.props.selection);
}
componentWillUnmount() {
public componentWillUnmount() {
this.autocompleter.destroy();
}
@ -265,7 +265,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
}
}
componentDidUpdate(prevProps: IProps) {
public componentDidUpdate(prevProps: IProps) {
this.applyNewProps(prevProps.query, prevProps.room);
// this is the selected completion, so scroll it into view if needed
const selectedCompletion = this.refs[`completion${this.state.selectionOffset}`] as HTMLElement;
@ -280,7 +280,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
}
}
render() {
public render() {
let position = 1;
const renderedCompletions = this.state.completions
.map((completionResult, i) => {

View file

@ -51,11 +51,11 @@ interface IState {
}
export default class AuxPanel extends React.Component<IProps, IState> {
static defaultProps = {
public static defaultProps = {
showApps: true,
};
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -63,20 +63,20 @@ export default class AuxPanel extends React.Component<IProps, IState> {
};
}
componentDidMount() {
public componentDidMount() {
const cli = MatrixClientPeg.get();
if (SettingsStore.getValue("feature_state_counters")) {
cli.on(RoomStateEvent.Events, this.onRoomStateEvents);
}
}
componentWillUnmount() {
public componentWillUnmount() {
if (SettingsStore.getValue("feature_state_counters")) {
MatrixClientPeg.get()?.removeListener(RoomStateEvent.Events, this.onRoomStateEvents);
}
}
shouldComponentUpdate(nextProps, nextState) {
public shouldComponentUpdate(nextProps, nextState) {
return objectHasDiff(this.props, nextProps) || objectHasDiff(this.state, nextState);
}
@ -125,7 +125,7 @@ export default class AuxPanel extends React.Component<IProps, IState> {
return counters;
}
render() {
public render() {
const callView = (
<LegacyCallViewForRoom
roomId={this.props.room.roomId}

View file

@ -140,7 +140,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
private readonly surroundWithHandle: string;
private readonly historyManager = new HistoryManager();
constructor(props) {
public constructor(props) {
super(props);
this.state = {
showPillAvatar: SettingsStore.getValue("Pill.shouldShowPillAvatar"),
@ -686,7 +686,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
if (shouldReplace) this.replaceEmoticon(documentPosition, REGEX_EMOTICON_WHITESPACE);
};
componentWillUnmount() {
public componentWillUnmount() {
document.removeEventListener("selectionchange", this.onSelectionChange);
this.editorRef.current.removeEventListener("input", this.onInput, true);
this.editorRef.current.removeEventListener("compositionstart", this.onCompositionStart, true);
@ -697,7 +697,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
SettingsStore.unwatchSetting(this.surroundWithHandle);
}
componentDidMount() {
public componentDidMount() {
const model = this.props.model;
model.setUpdateCallback(this.updateEditorState);
const partCreator = model.partCreator;
@ -746,7 +746,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
formatRange(range, action);
};
render() {
public render() {
let autoComplete;
if (this.state.autoComplete) {
const query = this.state.query;

View file

@ -123,14 +123,14 @@ interface IState {
}
class EditMessageComposer extends React.Component<IEditMessageComposerProps, IState> {
static contextType = RoomContext;
context!: React.ContextType<typeof RoomContext>;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
private readonly editorRef = createRef<BasicMessageComposer>();
private readonly dispatcherRef: string;
private model: EditorModel = null;
constructor(props: IEditMessageComposerProps, context: React.ContextType<typeof RoomContext>) {
public constructor(props: IEditMessageComposerProps, context: React.ContextType<typeof RoomContext>) {
super(props);
this.context = context; // otherwise React will only set it prior to render due to type def above
@ -369,7 +369,7 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
}
}
componentWillUnmount() {
public componentWillUnmount() {
// store caret and serialized parts in the
// editorstate so it can be restored when the remote echo event tile gets rendered
// in case we're currently editing a pending event
@ -446,7 +446,7 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
}
};
render() {
public render() {
return (
<div className={classNames("mx_EditMessageComposer", this.props.className)} onKeyDown={this.onKeyDown}>
<BasicMessageComposer

View file

@ -85,7 +85,7 @@ interface IState {
}
export default class EntityTile extends React.PureComponent<IProps, IState> {
static defaultProps = {
public static defaultProps = {
onClick: () => {},
presenceState: "offline",
presenceLastActiveAgo: 0,
@ -95,7 +95,7 @@ export default class EntityTile extends React.PureComponent<IProps, IState> {
showPresence: true,
};
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {
@ -103,7 +103,7 @@ export default class EntityTile extends React.PureComponent<IProps, IState> {
};
}
render() {
public render() {
const mainClassNames = {
mx_EntityTile: true,
mx_EntityTile_noHover: this.props.suppressOnHover,

View file

@ -260,17 +260,17 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
public readonly ref = createRef<HTMLElement>();
static defaultProps = {
public static defaultProps = {
// no-op function because onHeightChanged is optional yet some sub-components assume its existence
onHeightChanged: function () {},
forExport: false,
layout: Layout.Group,
};
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
constructor(props: EventTileProps, context: React.ContextType<typeof MatrixClientContext>) {
public constructor(props: EventTileProps, context: React.ContextType<typeof MatrixClientContext>) {
super(props, context);
const thread = this.thread;
@ -364,7 +364,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
return true;
}
componentDidMount() {
public componentDidMount() {
this.suppressReadReceiptAnimation = false;
const client = MatrixClientPeg.get();
if (!this.props.forExport) {
@ -442,7 +442,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
this.setState({ thread });
};
shouldComponentUpdate(nextProps: EventTileProps, nextState: IState): boolean {
public shouldComponentUpdate(nextProps: EventTileProps, nextState: IState): boolean {
if (objectHasDiff(this.state, nextState)) {
return true;
}
@ -450,7 +450,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
return !this.propsEqual(this.props, nextProps);
}
componentWillUnmount() {
public componentWillUnmount() {
const client = MatrixClientPeg.get();
if (client) {
client.removeListener(CryptoEvent.DeviceVerificationChanged, this.onDeviceVerificationChanged);
@ -470,7 +470,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
this.threadState?.off(NotificationStateEvents.Update, this.onThreadStateUpdate);
}
componentDidUpdate(prevProps: Readonly<EventTileProps>) {
public componentDidUpdate(prevProps: Readonly<EventTileProps>) {
// If we're not listening for receipts and expect to be, register a listener.
if (!this.isListeningForReceipts && (this.shouldShowSentReceipt || this.shouldShowSendingReceipt)) {
MatrixClientPeg.get().on(RoomEvent.Receipt, this.onRoomReceipt);
@ -1558,7 +1558,7 @@ interface IE2ePadlockState {
}
class E2ePadlock extends React.Component<IE2ePadlockProps, IE2ePadlockState> {
constructor(props: IE2ePadlockProps) {
public constructor(props: IE2ePadlockProps) {
super(props);
this.state = {

View file

@ -36,7 +36,7 @@ interface IState {
}
export default class ExtraTile extends React.Component<IProps, IState> {
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -38,13 +38,13 @@ export default class LinkPreviewWidget extends React.Component<IProps> {
private readonly description = createRef<HTMLDivElement>();
private image = createRef<HTMLImageElement>();
componentDidMount() {
public componentDidMount() {
if (this.description.current) {
linkifyElement(this.description.current);
}
}
componentDidUpdate() {
public componentDidUpdate() {
if (this.description.current) {
linkifyElement(this.description.current);
}
@ -83,7 +83,7 @@ export default class LinkPreviewWidget extends React.Component<IProps> {
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox", null, true);
};
render() {
public render() {
const p = this.props.preview;
if (!p || Object.keys(p).length === 0) {
return <div />;

View file

@ -71,10 +71,10 @@ export default class MemberList extends React.Component<IProps, IState> {
private showPresence = true;
private mounted = false;
static contextType = SDKContext;
public static contextType = SDKContext;
public context!: React.ContextType<typeof SDKContext>;
constructor(props: IProps, context: React.ContextType<typeof SDKContext>) {
public constructor(props: IProps, context: React.ContextType<typeof SDKContext>) {
super(props);
this.state = this.getMembersState([], []);
this.showPresence = context.memberListStore.isPresenceEnabled();
@ -97,7 +97,7 @@ export default class MemberList extends React.Component<IProps, IState> {
cli.on(RoomEvent.MyMembership, this.onMyMembership);
}
componentDidMount(): void {
public componentDidMount(): void {
this.updateListNow(true);
}
@ -359,7 +359,7 @@ export default class MemberList extends React.Component<IProps, IState> {
return this.state.filteredInvitedMembers.length + (this.getPending3PidInvites() || []).length;
};
render() {
public render() {
if (this.state.loading) {
return (
<BaseCard className="mx_MemberList" onClose={this.props.onClose}>

View file

@ -47,11 +47,11 @@ export default class MemberTile extends React.Component<IProps, IState> {
private userLastModifiedTime: number;
private memberLastModifiedTime: number;
static defaultProps = {
public static defaultProps = {
showPresence: true,
};
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -60,7 +60,7 @@ export default class MemberTile extends React.Component<IProps, IState> {
};
}
componentDidMount() {
public componentDidMount() {
const cli = MatrixClientPeg.get();
const { roomId } = this.props.member;
@ -80,7 +80,7 @@ export default class MemberTile extends React.Component<IProps, IState> {
}
}
componentWillUnmount() {
public componentWillUnmount() {
const cli = MatrixClientPeg.get();
if (cli) {
@ -142,7 +142,7 @@ export default class MemberTile extends React.Component<IProps, IState> {
});
}
shouldComponentUpdate(nextProps: IProps, nextState: IState): boolean {
public shouldComponentUpdate(nextProps: IProps, nextState: IState): boolean {
if (
this.memberLastModifiedTime === undefined ||
this.memberLastModifiedTime < nextProps.member.getLastModifiedTime()
@ -183,7 +183,7 @@ export default class MemberTile extends React.Component<IProps, IState> {
}).trim();
}
render() {
public render() {
const member = this.props.member;
const name = this.getDisplayName();
const presenceState = member.user ? member.user.presence : null;

View file

@ -41,12 +41,12 @@ interface IState {
export default class MessageComposerFormatBar extends React.PureComponent<IProps, IState> {
private readonly formatBarRef = createRef<HTMLDivElement>();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = { visible: false };
}
render() {
public render() {
const classes = classNames("mx_MessageComposerFormatBar", {
mx_MessageComposerFormatBar_shown: this.state.visible,
});
@ -124,7 +124,7 @@ interface IFormatButtonProps {
}
class FormatButton extends React.PureComponent<IFormatButtonProps> {
render() {
public render() {
const className = `mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIcon${this.props.icon}`;
let shortcut;
if (this.props.shortcut) {

View file

@ -55,7 +55,7 @@ interface IState {
export default class NotificationBadge extends React.PureComponent<XOR<IProps, IClickableProps>, IState> {
private countWatcherRef: string;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.props.notification.on(NotificationStateEvents.Update, this.onNotificationUpdate);

View file

@ -69,7 +69,7 @@ export default class PinnedEventTile extends React.Component<IProps> {
}
};
async componentDidMount() {
public async componentDidMount() {
// Fetch poll responses
if (M_POLL_START.matches(this.props.event.getType())) {
const eventId = this.props.event.getId();
@ -110,7 +110,7 @@ export default class PinnedEventTile extends React.Component<IProps> {
}
}
render() {
public render() {
const sender = this.props.event.getSender();
let unpinButton = null;

View file

@ -33,7 +33,7 @@ interface IProps {
}
export default class PresenceLabel extends React.Component<IProps> {
static defaultProps = {
public static defaultProps = {
activeAgo: -1,
presenceState: null,
};
@ -82,7 +82,7 @@ export default class PresenceLabel extends React.Component<IProps> {
}
}
render() {
public render() {
return (
<div className="mx_PresenceLabel">
{this.getPrettyPresence(this.props.presenceState, this.props.activeAgo, this.props.currentlyActive)}

View file

@ -75,7 +75,7 @@ interface IReadReceiptMarkerStyle {
export default class ReadReceiptMarker extends React.PureComponent<IProps, IState> {
private avatar: React.RefObject<HTMLDivElement | HTMLImageElement | HTMLSpanElement> = createRef();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -48,17 +48,17 @@ interface IProps {
export default class ReplyTile extends React.PureComponent<IProps> {
private anchorElement = createRef<HTMLAnchorElement>();
static defaultProps = {
public static defaultProps = {
onHeightChanged: () => {},
};
componentDidMount() {
public componentDidMount() {
this.props.mxEvent.on(MatrixEventEvent.Decrypted, this.onDecrypted);
this.props.mxEvent.on(MatrixEventEvent.BeforeRedaction, this.onEventRequiresUpdate);
this.props.mxEvent.on(MatrixEventEvent.Replaced, this.onEventRequiresUpdate);
}
componentWillUnmount() {
public componentWillUnmount() {
this.props.mxEvent.removeListener(MatrixEventEvent.Decrypted, this.onDecrypted);
this.props.mxEvent.removeListener(MatrixEventEvent.BeforeRedaction, this.onEventRequiresUpdate);
this.props.mxEvent.removeListener(MatrixEventEvent.Replaced, this.onEventRequiresUpdate);
@ -104,7 +104,7 @@ export default class ReplyTile extends React.PureComponent<IProps> {
}
};
render() {
public render() {
const mxEvent = this.props.mxEvent;
const msgType = mxEvent.getContent().msgtype;
const evType = mxEvent.getType();

View file

@ -71,7 +71,7 @@ const RoomBreadcrumbTile = ({ room, onClick }: { room: Room; onClick: (ev: Butto
export default class RoomBreadcrumbs extends React.PureComponent<IProps, IState> {
private isMounted = true;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -71,7 +71,7 @@ import { Alignment } from "../elements/Tooltip";
import RoomCallBanner from "../beacon/RoomCallBanner";
class DisabledWithReason {
constructor(public readonly reason: string) {}
public constructor(public readonly reason: string) {}
}
interface VoiceCallButtonProps {
@ -482,7 +482,7 @@ interface IState {
}
export default class RoomHeader extends React.Component<IProps, IState> {
static defaultProps = {
public static defaultProps = {
editing: false,
inRoom: false,
excludedRightPanelPhaseButtons: [],
@ -490,11 +490,11 @@ export default class RoomHeader extends React.Component<IProps, IState> {
enableRoomOptionsMenu: true,
};
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
private readonly client = this.props.room.client;
constructor(props: IProps, context: IState) {
public constructor(props: IProps, context: IState) {
super(props, context);
const notiStore = RoomNotificationStateStore.instance.getRoomState(props.room);
notiStore.on(NotificationStateEvents.Update, this.onNotificationUpdate);

View file

@ -438,10 +438,10 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
private treeRef = createRef<HTMLDivElement>();
private favouriteMessageWatcher: string;
static contextType = MatrixClientContext;
public static contextType = MatrixClientContext;
public context!: React.ContextType<typeof MatrixClientContext>;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -100,11 +100,11 @@ interface IState {
}
export default class RoomPreviewBar extends React.Component<IProps, IState> {
static defaultProps = {
public static defaultProps = {
onJoinClick() {},
};
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -112,11 +112,11 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
};
}
componentDidMount() {
public componentDidMount() {
this.checkInvitedEmail();
}
componentDidUpdate(prevProps, prevState) {
public componentDidUpdate(prevProps, prevState) {
if (this.props.invitedEmail !== prevProps.invitedEmail || this.props.inviterName !== prevProps.inviterName) {
this.checkInvitedEmail();
}
@ -270,7 +270,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
dis.dispatch({ action: "start_registration", screenAfterLogin: this.makeScreenAfterLogin() });
};
render() {
public render() {
const brand = SdkConfig.get().brand;
const roomName = this.props.room?.name ?? this.props.roomAlias ?? "";
const isSpace = this.props.room?.isSpaceRoom() ?? this.props.oobData?.roomType === RoomType.Space;

View file

@ -114,7 +114,7 @@ export default class RoomSublist extends React.Component<IProps, IState> {
private slidingSyncMode: boolean;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
// when this setting is toggled it restarts the app so it's safe to not watch this.
this.slidingSyncMode = SettingsStore.getValue("feature_sliding_sync");

View file

@ -87,7 +87,7 @@ export class RoomTile extends React.PureComponent<ClassProps, State> {
private notificationState: NotificationState;
private roomProps: RoomEchoChamber;
constructor(props: ClassProps) {
public constructor(props: ClassProps) {
super(props);
this.state = {

View file

@ -34,10 +34,10 @@ interface IState {
}
export default class RoomUpgradeWarningBar extends React.PureComponent<IProps, IState> {
static contextType = MatrixClientContext;
public static contextType = MatrixClientContext;
public context!: React.ContextType<typeof MatrixClientContext>;
constructor(props, context) {
public constructor(props, context) {
super(props, context);
const tombstone = this.props.room.currentState.getStateEvents("m.room.tombstone", "");

View file

@ -44,7 +44,7 @@ export enum SearchScope {
export default class SearchBar extends React.Component<IProps, IState> {
private searchTerm: RefObject<HTMLInputElement> = createRef();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {
scope: SearchScope.Room,

View file

@ -41,13 +41,13 @@ interface IProps {
}
export default class SearchResultTile extends React.Component<IProps> {
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
// A map of <callId, LegacyCallEventGrouper>
private callEventGroupers = new Map<string, LegacyCallEventGrouper>();
constructor(props, context) {
public constructor(props, context) {
super(props, context);
this.buildLegacyCallEventGroupers(this.props.searchResult.context.getTimeline());

View file

@ -143,7 +143,7 @@ interface ISendMessageComposerProps extends MatrixClientProps {
}
export class SendMessageComposer extends React.Component<ISendMessageComposerProps> {
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
private readonly prepareToEncrypt?: DebouncedFunc<() => void>;
@ -153,11 +153,11 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
private dispatcherRef: string;
private sendHistoryManager: SendHistoryManager;
static defaultProps = {
public static defaultProps = {
includeReplyLegacyFallback: true,
};
constructor(props: ISendMessageComposerProps, context: React.ContextType<typeof RoomContext>) {
public constructor(props: ISendMessageComposerProps, context: React.ContextType<typeof RoomContext>) {
super(props, context);
this.context = context; // otherwise React will only set it prior to render due to type def above
@ -462,7 +462,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
}
}
componentWillUnmount() {
public componentWillUnmount() {
dis.unregister(this.dispatcherRef);
window.removeEventListener("beforeunload", this.saveStoredEditorState);
this.saveStoredEditorState();
@ -572,7 +572,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
this.editorRef.current?.focus();
};
render() {
public render() {
const threadId =
this.props.relation?.rel_type === THREAD_RELATION_TYPE.name ? this.props.relation.event_id : null;
return (

View file

@ -58,11 +58,11 @@ interface IState {
}
export default class Stickerpicker extends React.PureComponent<IProps, IState> {
static defaultProps = {
public static defaultProps = {
threadId: null,
};
static currentWidget;
public static currentWidget;
private dispatcherRef: string;
@ -73,7 +73,7 @@ export default class Stickerpicker extends React.PureComponent<IProps, IState> {
// This is loaded by _acquireScalarClient on an as-needed basis.
private scalarClient: ScalarAuthClient = null;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {
imError: null,

View file

@ -47,7 +47,7 @@ interface IState {
export default class ThirdPartyMemberInfo extends React.Component<IProps, IState> {
private room: Room;
constructor(props) {
public constructor(props) {
super(props);
this.room = MatrixClientPeg.get().getRoom(this.props.event.getRoomId());
@ -69,18 +69,18 @@ export default class ThirdPartyMemberInfo extends React.Component<IProps, IState
};
}
componentDidMount(): void {
public componentDidMount(): void {
MatrixClientPeg.get().on(RoomStateEvent.Events, this.onRoomStateEvents);
}
componentWillUnmount(): void {
public componentWillUnmount(): void {
const client = MatrixClientPeg.get();
if (client) {
client.removeListener(RoomStateEvent.Events, this.onRoomStateEvents);
}
}
onRoomStateEvents = (ev: MatrixEvent) => {
public onRoomStateEvents = (ev: MatrixEvent) => {
if (ev.getType() === EventType.RoomThirdPartyInvite && ev.getStateKey() === this.state.stateKey) {
const newDisplayName = ev.getContent().display_name;
const isInvited = isValid3pidInvite(ev);
@ -91,14 +91,14 @@ export default class ThirdPartyMemberInfo extends React.Component<IProps, IState
}
};
onCancel = () => {
public onCancel = () => {
dis.dispatch({
action: "view_3pid_invite",
event: null,
});
};
onKickClick = () => {
public onKickClick = () => {
MatrixClientPeg.get()
.sendStateEvent(this.state.roomId, "m.room.third_party_invite", {}, this.state.stateKey)
.catch((err) => {
@ -120,7 +120,7 @@ export default class ThirdPartyMemberInfo extends React.Component<IProps, IState
this.setState({ invited: false });
};
render() {
public render() {
let adminTools = null;
if (this.state.canKick && this.state.invited) {
adminTools = (

View file

@ -63,7 +63,7 @@ interface IState {
* Container tile for rendering the voice message recorder in the composer.
*/
export default class VoiceRecordComposerTile extends React.PureComponent<IProps, IState> {
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
private voiceRecordingId: string;

View file

@ -47,21 +47,21 @@ interface IState {
}
export default class WhoIsTypingTile extends React.Component<IProps, IState> {
static defaultProps = {
public static defaultProps = {
whoIsTypingLimit: 3,
};
state = {
public state = {
usersTyping: WhoIsTyping.usersTypingApartFromMe(this.props.room),
delayedStopTypingTimers: {},
};
componentDidMount() {
public componentDidMount() {
MatrixClientPeg.get().on(RoomMemberEvent.Typing, this.onRoomMemberTyping);
MatrixClientPeg.get().on(RoomEvent.Timeline, this.onRoomTimeline);
}
componentDidUpdate(_, prevState) {
public componentDidUpdate(_, prevState) {
const wasVisible = WhoIsTypingTile.isVisible(prevState);
const isVisible = WhoIsTypingTile.isVisible(this.state);
if (this.props.onShown && !wasVisible && isVisible) {
@ -71,7 +71,7 @@ export default class WhoIsTypingTile extends React.Component<IProps, IState> {
}
}
componentWillUnmount() {
public componentWillUnmount() {
// we may have entirely lost our client as we're logging out before clicking login on the guest bar...
const client = MatrixClientPeg.get();
if (client) {
@ -199,7 +199,7 @@ export default class WhoIsTypingTile extends React.Component<IProps, IState> {
return avatars;
}
render() {
public render() {
let usersTyping = this.state.usersTyping;
const stoppedUsersOnTimer = Object.keys(this.state.delayedStopTypingTimers).map((userId) =>
this.props.room.getMember(userId),