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

@ -33,7 +33,7 @@ export type IProps<T extends keyof JSX.IntrinsicElements> = DynamicHtmlElementPr
};
export default class AutoHideScrollbar<T extends keyof JSX.IntrinsicElements> extends React.Component<IProps<T>> {
static defaultProps = {
public static defaultProps = {
element: "div" as keyof ReactHTML,
};

View file

@ -112,12 +112,12 @@ interface IState {
export default class ContextMenu extends React.PureComponent<IProps, IState> {
private readonly initialFocus: HTMLElement;
static defaultProps = {
public static defaultProps = {
hasBackground: true,
managed: true,
};
constructor(props, context) {
public constructor(props, context) {
super(props, context);
this.state = {
@ -447,7 +447,7 @@ export default class ContextMenu extends React.PureComponent<IProps, IState> {
);
}
render(): React.ReactChild {
public render(): React.ReactChild {
if (this.props.mountAsChild) {
// Render as a child of the current parent
return this.renderMenu();

View file

@ -48,7 +48,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
private unmounted = false;
private dispatcherRef: string = null;
constructor(props: IProps, context: typeof MatrixClientContext) {
public constructor(props: IProps, context: typeof MatrixClientContext) {
super(props, context);
this.state = {

View file

@ -51,7 +51,7 @@ interface IState {
* Component which shows the filtered file using a TimelinePanel
*/
class FilePanel extends React.Component<IProps, IState> {
static contextType = RoomContext;
public static contextType = RoomContext;
// This is used to track if a decrypted event was a live event and should be
// added to the timeline.
@ -59,7 +59,7 @@ class FilePanel extends React.Component<IProps, IState> {
public noRoom: boolean;
private card = createRef<HTMLDivElement>();
state = {
public state = {
timelineSet: null,
narrow: false,
};

View file

@ -22,7 +22,7 @@ interface IProps {
}
export default class GenericErrorPage extends React.PureComponent<IProps> {
render() {
public render() {
return (
<div className="mx_GenericErrorPage">
<div className="mx_GenericErrorPage_box">

View file

@ -47,7 +47,7 @@ export default class IndicatorScrollbar<T extends keyof JSX.IntrinsicElements> e
private likelyTrackpadUser: boolean = null;
private checkAgainForTrackpad = 0; // ts in milliseconds to recheck this._likelyTrackpadUser
constructor(props: IProps<T>) {
public constructor(props: IProps<T>) {
super(props);
this.state = {

View file

@ -99,7 +99,7 @@ export default class InteractiveAuthComponent extends React.Component<IProps, IS
private unmounted = false;
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -155,7 +155,7 @@ export default class InteractiveAuthComponent extends React.Component<IProps, IS
});
}
componentWillUnmount() {
public componentWillUnmount() {
this.unmounted = true;
if (this.intervalId !== null) {
@ -249,7 +249,7 @@ export default class InteractiveAuthComponent extends React.Component<IProps, IS
this.authLogic.setEmailSid(sid);
};
render() {
public render() {
const stage = this.state.authStage;
if (!stage) {
if (this.state.busy) {

View file

@ -71,7 +71,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
private focusedElement = null;
private isDoingStickyHeaders = false;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -75,7 +75,7 @@ export default class LegacyCallEventGrouper extends EventEmitter {
private call: MatrixCall;
public state: CallState | CustomCallState;
constructor() {
public constructor() {
super();
LegacyCallHandler.instance.addListener(LegacyCallHandlerEvent.CallsChanged, this.setCall);

View file

@ -125,7 +125,7 @@ interface IState {
* Components mounted below us can access the matrix client via the react context.
*/
class LoggedInView extends React.Component<IProps, IState> {
static displayName = "LoggedInView";
public static displayName = "LoggedInView";
protected readonly _matrixClient: MatrixClient;
protected readonly _roomView: React.RefObject<RoomViewType>;
@ -136,7 +136,7 @@ class LoggedInView extends React.Component<IProps, IState> {
protected backgroundImageWatcherRef: string;
protected resizer: Resizer;
constructor(props, context) {
public constructor(props, context) {
super(props, context);
this.state = {
@ -159,7 +159,7 @@ class LoggedInView extends React.Component<IProps, IState> {
this.resizeHandler = React.createRef();
}
componentDidMount() {
public componentDidMount() {
document.addEventListener("keydown", this.onNativeKeyDown, false);
LegacyCallHandler.instance.addListener(LegacyCallHandlerEvent.CallState, this.onCallState);
@ -191,7 +191,7 @@ class LoggedInView extends React.Component<IProps, IState> {
this.refreshBackgroundImage();
}
componentWillUnmount() {
public componentWillUnmount() {
document.removeEventListener("keydown", this.onNativeKeyDown, false);
LegacyCallHandler.instance.removeListener(LegacyCallHandlerEvent.CallState, this.onCallState);
this._matrixClient.removeListener(ClientEvent.AccountData, this.onAccountData);
@ -621,7 +621,7 @@ class LoggedInView extends React.Component<IProps, IState> {
}
};
render() {
public render() {
let pageElement;
switch (this.props.page_type) {

View file

@ -210,9 +210,9 @@ interface IState {
}
export default class MatrixChat extends React.PureComponent<IProps, IState> {
static displayName = "MatrixChat";
public static displayName = "MatrixChat";
static defaultProps = {
public static defaultProps = {
realQueryParams: {},
startingFragmentQueryParams: {},
config: {},
@ -237,7 +237,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
private readonly fontWatcher: FontWatcher;
private readonly stores: SdkContextClass;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.stores = SdkContextClass.instance;
this.stores.constructEagerStores();
@ -417,7 +417,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
window.addEventListener("resize", this.onWindowResized);
}
componentDidUpdate(prevProps, prevState) {
public componentDidUpdate(prevProps, prevState) {
if (this.shouldTrackPageChange(prevState, this.state)) {
const durationMs = this.stopPageChangeTimer();
PosthogTrackers.instance.trackPageChange(this.state.view, this.state.page_type, durationMs);
@ -428,7 +428,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
}
}
componentWillUnmount() {
public componentWillUnmount() {
Lifecycle.stopMatrixClient();
dis.unregister(this.dispatcherRef);
this.themeWatcher.stop();
@ -2016,7 +2016,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
return fragmentAfterLogin;
}
render() {
public render() {
const fragmentAfterLogin = this.getFragmentAfterLogin();
let view = null;

View file

@ -214,10 +214,10 @@ interface IReadReceiptForUser {
/* (almost) stateless UI component which builds the event tiles in the room timeline.
*/
export default class MessagePanel extends React.Component<IProps, IState> {
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
static defaultProps = {
public static defaultProps = {
disableGrouping: false,
};
@ -272,7 +272,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
// A map to allow groupers to maintain consistent keys even if their first event is uprooted due to back-pagination.
public grouperKeyMap = new WeakMap<MatrixEvent, string>();
constructor(props, context) {
public constructor(props, context) {
super(props, context);
this.state = {
@ -296,19 +296,19 @@ export default class MessagePanel extends React.Component<IProps, IState> {
);
}
componentDidMount() {
public componentDidMount() {
this.calculateRoomMembersCount();
this.props.room?.currentState.on(RoomStateEvent.Update, this.calculateRoomMembersCount);
this.isMounted = true;
}
componentWillUnmount() {
public componentWillUnmount() {
this.isMounted = false;
this.props.room?.currentState.off(RoomStateEvent.Update, this.calculateRoomMembersCount);
SettingsStore.unwatchSetting(this.showTypingNotificationsWatcherRef);
}
componentDidUpdate(prevProps, prevState) {
public componentDidUpdate(prevProps, prevState) {
if (prevProps.layout !== this.props.layout) {
this.calculateRoomMembersCount();
}
@ -982,7 +982,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
}
}
render() {
public render() {
let topSpinner;
let bottomSpinner;
if (this.props.backPaginating) {
@ -1057,14 +1057,14 @@ export default class MessagePanel extends React.Component<IProps, IState> {
}
abstract class BaseGrouper {
static canStartGroup = (panel: MessagePanel, ev: MatrixEvent): boolean => true;
public static canStartGroup = (panel: MessagePanel, ev: MatrixEvent): boolean => true;
public events: MatrixEvent[] = [];
// events that we include in the group but then eject out and place above the group.
public ejectedEvents: MatrixEvent[] = [];
public readMarker: ReactNode;
constructor(
public constructor(
public readonly panel: MessagePanel,
public readonly event: MatrixEvent,
public readonly prevEvent: MatrixEvent,
@ -1097,7 +1097,7 @@ abstract class BaseGrouper {
// Grouping only events sent by the same user that sent the `m.room.create` and only until
// the first non-state event, beacon_info event or membership event which is not regarding the sender of the `m.room.create` event
class CreationGrouper extends BaseGrouper {
static canStartGroup = function (panel: MessagePanel, ev: MatrixEvent): boolean {
public static canStartGroup = function (panel: MessagePanel, ev: MatrixEvent): boolean {
return ev.getType() === EventType.RoomCreate;
};
@ -1231,7 +1231,7 @@ class CreationGrouper extends BaseGrouper {
// Wrap consecutive grouped events in a ListSummary
class MainGrouper extends BaseGrouper {
static canStartGroup = function (panel: MessagePanel, ev: MatrixEvent): boolean {
public static canStartGroup = function (panel: MessagePanel, ev: MatrixEvent): boolean {
if (!panel.shouldShowEvent(ev)) return false;
if (ev.isState() && groupedStateEvents.includes(ev.getType() as EventType)) {
@ -1249,7 +1249,7 @@ class MainGrouper extends BaseGrouper {
return false;
};
constructor(
public constructor(
public readonly panel: MessagePanel,
public readonly event: MatrixEvent,
public readonly prevEvent: MatrixEvent,

View file

@ -38,11 +38,11 @@ interface IState {
* Component which shows the global notification list using a TimelinePanel
*/
export default class NotificationPanel extends React.PureComponent<IProps, IState> {
static contextType = RoomContext;
public static contextType = RoomContext;
private card = React.createRef<HTMLDivElement>();
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -54,7 +54,7 @@ export default class NotificationPanel extends React.PureComponent<IProps, IStat
this.setState({ narrow });
};
render() {
public render() {
const emptyState = (
<div className="mx_RightPanel_empty mx_NotificationPanel_empty">
<h2>{_t("You're all caught up")}</h2>

View file

@ -60,10 +60,10 @@ interface IState {
}
export default class RightPanel extends React.Component<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);
this.state = {

View file

@ -33,7 +33,7 @@ interface IProps {
export default class RoomSearch extends React.PureComponent<IProps> {
private readonly dispatcherRef: string;
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.dispatcherRef = defaultDispatcher.register(this.onAction);

View file

@ -89,7 +89,7 @@ export default class RoomStatusBar extends React.PureComponent<IProps, IState> {
private unmounted = false;
public static contextType = MatrixClientContext;
constructor(props: IProps, context: typeof MatrixClientContext) {
public constructor(props: IProps, context: typeof MatrixClientContext) {
super(props, context);
this.state = {

View file

@ -371,10 +371,10 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
private messagePanel: TimelinePanel;
private roomViewBody = createRef<HTMLDivElement>();
static contextType = SDKContext;
public static contextType = SDKContext;
public context!: React.ContextType<typeof SDKContext>;
constructor(props: IRoomProps, context: React.ContextType<typeof SDKContext>) {
public constructor(props: IRoomProps, context: React.ContextType<typeof SDKContext>) {
super(props, context);
const llMembers = context.client.hasLazyLoadMembersEnabled();
@ -838,7 +838,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
return isManuallyShown && widgets.length > 0;
}
componentDidMount() {
public componentDidMount() {
this.onRoomViewStoreUpdate(true);
const call = this.getCallForRoom();
@ -851,7 +851,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
window.addEventListener("beforeunload", this.onPageUnload);
}
shouldComponentUpdate(nextProps, nextState) {
public shouldComponentUpdate(nextProps, nextState) {
const hasPropsDiff = objectHasDiff(this.props, nextProps);
const { upgradeRecommendation, ...state } = this.state;
@ -864,7 +864,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
return hasPropsDiff || hasStateDiff;
}
componentDidUpdate() {
public componentDidUpdate() {
// Note: We check the ref here with a flag because componentDidMount, despite
// documentation, does not define our messagePanel ref. It looks like our spinner
// in render() prevents the ref from being set on first mount, so we try and
@ -877,7 +877,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
}
}
componentWillUnmount() {
public componentWillUnmount() {
// set a boolean to say we've been unmounted, which any pending
// promises can use to throw away their results.
//
@ -1804,13 +1804,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
return this.context.client.getRoom(createEvent.getContent()["predecessor"]["room_id"]);
}
getHiddenHighlightCount() {
public getHiddenHighlightCount() {
const oldRoom = this.getOldRoom();
if (!oldRoom) return 0;
return oldRoom.getUnreadNotificationCount(NotificationCountType.Highlight);
}
onHiddenHighlightsClick = () => {
public onHiddenHighlightsClick = () => {
const oldRoom = this.getOldRoom();
if (!oldRoom) return;
dis.dispatch<ViewRoomPayload>({
@ -1869,7 +1869,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
);
}
render() {
public render() {
if (this.state.room instanceof LocalRoom) {
if (this.state.room.state === LocalRoomState.CREATING) {
return this.renderLocalRoomCreateLoader();

View file

@ -195,7 +195,7 @@ export default class ScrollPanel extends React.Component<IProps> {
private heightUpdateInProgress: boolean;
private divScroll: HTMLDivElement;
constructor(props, context) {
public constructor(props, context) {
super(props, context);
this.props.resizeNotifier?.on("middlePanelResizedNoisy", this.onResize);

View file

@ -45,7 +45,7 @@ interface IState {
export default class SearchBox extends React.Component<IProps, IState> {
private search = createRef<HTMLInputElement>();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

@ -611,13 +611,13 @@ const SpaceSetupPrivateInvite = ({ space, onFinished }) => {
};
export default class SpaceRoomView extends React.PureComponent<IProps, IState> {
static contextType = MatrixClientContext;
public static contextType = MatrixClientContext;
public context!: React.ContextType<typeof MatrixClientContext>;
private readonly creator: string;
private readonly dispatcherRef: string;
constructor(props: IProps, context: React.ContextType<typeof MatrixClientContext>) {
public constructor(props: IProps, context: React.ContextType<typeof MatrixClientContext>) {
super(props, context);
let phase = Phase.Landing;
@ -642,11 +642,11 @@ export default class SpaceRoomView extends React.PureComponent<IProps, IState> {
RightPanelStore.instance.on(UPDATE_EVENT, this.onRightPanelStoreUpdate);
}
componentDidMount() {
public componentDidMount() {
this.context.on(RoomEvent.MyMembership, this.onMyMembership);
}
componentWillUnmount() {
public componentWillUnmount() {
defaultDispatcher.unregister(this.dispatcherRef);
RightPanelStore.instance.off(UPDATE_EVENT, this.onRightPanelStoreUpdate);
this.context.off(RoomEvent.MyMembership, this.onMyMembership);
@ -794,7 +794,7 @@ export default class SpaceRoomView extends React.PureComponent<IProps, IState> {
}
}
render() {
public render() {
const rightPanel =
this.state.showRightPanel && this.state.phase === Phase.Landing ? (
<RightPanel room={this.props.space} resizeNotifier={this.props.resizeNotifier} />

View file

@ -37,7 +37,7 @@ export class Tab {
* @param {React.ReactNode} body The JSX for the tab container.
* @param {string} screenName The screen name to report to Posthog.
*/
constructor(
public constructor(
public readonly id: string,
public readonly label: string,
public readonly icon: string,
@ -64,7 +64,7 @@ interface IState {
}
export default class TabbedView extends React.Component<IProps, IState> {
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
const initialTabIdIsValid = props.tabs.find((tab) => tab.id === props.initialTabId);
@ -73,7 +73,7 @@ export default class TabbedView extends React.Component<IProps, IState> {
};
}
static defaultProps = {
public static defaultProps = {
tabLocation: TabLocation.LEFT,
};

View file

@ -76,7 +76,7 @@ interface IState {
}
export default class ThreadView extends React.Component<IProps, IState> {
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
private dispatcherRef: string;
@ -84,7 +84,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
private timelinePanel = createRef<TimelinePanel>();
private card = createRef<HTMLDivElement>();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
const thread = this.props.room.getThread(this.props.mxEvent.getId());

View file

@ -227,13 +227,13 @@ interface IEventIndexOpts {
* Also responsible for handling and sending read receipts.
*/
class TimelinePanel extends React.Component<IProps, IState> {
static contextType = RoomContext;
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
// a map from room id to read marker event timestamp
static roomReadMarkerTsMap: Record<string, number> = {};
public static roomReadMarkerTsMap: Record<string, number> = {};
static defaultProps = {
public static defaultProps = {
// By default, disable the timelineCap in favour of unpaginating based on
// event tile heights. (See _unpaginateEvents)
timelineCap: Number.MAX_VALUE,
@ -257,7 +257,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
// A map of <callId, LegacyCallEventGrouper>
private callEventGroupers = new Map<string, LegacyCallEventGrouper>();
constructor(props: IProps, context: React.ContextType<typeof RoomContext>) {
public constructor(props: IProps, context: React.ContextType<typeof RoomContext>) {
super(props, context);
this.context = context;
@ -360,7 +360,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
}
}
componentWillUnmount() {
public componentWillUnmount() {
// set a boolean to say we've been unmounted, which any pending
// promises can use to throw away their results.
//
@ -1883,7 +1883,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
this.callEventGroupers = buildLegacyCallEventGroupers(this.callEventGroupers, events);
}
render() {
public render() {
// just show a spinner while the timeline loads.
//
// put it in a div of the right class (mx_RoomView_messagePanel) so

View file

@ -25,7 +25,7 @@ interface IState {
}
export default class ToastContainer extends React.Component<{}, IState> {
constructor(props, context) {
public constructor(props, context) {
super(props, context);
this.state = {
toasts: ToastStore.sharedInstance().getToasts(),
@ -39,7 +39,7 @@ export default class ToastContainer extends React.Component<{}, IState> {
ToastStore.sharedInstance().on("update", this.onToastStoreUpdate);
}
componentWillUnmount() {
public componentWillUnmount() {
ToastStore.sharedInstance().removeListener("update", this.onToastStoreUpdate);
}
@ -50,7 +50,7 @@ export default class ToastContainer extends React.Component<{}, IState> {
});
};
render() {
public render() {
const totalCount = this.state.toasts.length;
const isStacked = totalCount > 1;
let toast;

View file

@ -57,7 +57,7 @@ export default class UploadBar extends React.PureComponent<IProps, IState> {
private dispatcherRef: Optional<string>;
private mounted = false;
constructor(props) {
public constructor(props) {
super(props);
// Set initial state to any available upload in this room - we might be mounting
@ -65,12 +65,12 @@ export default class UploadBar extends React.PureComponent<IProps, IState> {
this.state = this.calculateState();
}
componentDidMount() {
public componentDidMount() {
this.dispatcherRef = dis.register(this.onAction);
this.mounted = true;
}
componentWillUnmount() {
public componentWillUnmount() {
this.mounted = false;
dis.unregister(this.dispatcherRef!);
}
@ -103,7 +103,7 @@ export default class UploadBar extends React.PureComponent<IProps, IState> {
ContentMessages.sharedInstance().cancelUpload(this.state.currentUpload!);
};
render() {
public render() {
if (!this.state.currentFile) {
return null;
}

View file

@ -93,7 +93,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
private buttonRef: React.RefObject<HTMLButtonElement> = createRef();
private voiceBroadcastRecordingStore = VoiceBroadcastRecordingsStore.instance();
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
this.state = {

View file

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

View file

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

View file

@ -33,7 +33,7 @@ interface IState {
}
export default class CompleteSecurity extends React.Component<IProps, IState> {
constructor(props: IProps) {
public constructor(props: IProps) {
super(props);
const store = SetupEncryptionStore.sharedInstance();
store.on("update", this.onStoreUpdate);

View file

@ -27,7 +27,7 @@ interface IProps {
}
export default class E2eSetup extends React.Component<IProps> {
render() {
public render() {
return (
<AuthPage>
<CompleteSecurityBody>

View file

@ -350,7 +350,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
} as any);
};
renderEnterEmail(): JSX.Element {
public renderEnterEmail(): JSX.Element {
return (
<EnterEmail
email={this.state.email}
@ -364,7 +364,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
);
}
async renderConfirmLogoutDevicesDialog(): Promise<boolean> {
public async renderConfirmLogoutDevicesDialog(): Promise<boolean> {
const { finished } = Modal.createDialog<[boolean]>(QuestionDialog, {
title: _t("Warning!"),
description: (
@ -395,7 +395,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
return confirmed;
}
renderCheckEmail(): JSX.Element {
public renderCheckEmail(): JSX.Element {
return (
<CheckEmail
email={this.state.email}
@ -407,7 +407,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
);
}
renderSetPassword(): JSX.Element {
public renderSetPassword(): JSX.Element {
const submitButtonChild =
this.state.phase === Phase.ResettingPassword ? <Spinner w={16} h={16} /> : _t("Reset password");
@ -460,7 +460,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
);
}
renderDone() {
public renderDone() {
return (
<>
<CheckboxIcon className="mx_Icon mx_Icon_32 mx_Icon_accent" />
@ -484,7 +484,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
);
}
render() {
public render() {
let resetPasswordJsx: JSX.Element;
switch (this.state.phase) {

View file

@ -110,7 +110,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
private readonly stepRendererMap: Record<string, () => ReactNode>;
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -148,7 +148,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
this.initLoginLogic(this.props.serverConfig);
}
componentWillUnmount() {
public componentWillUnmount() {
this.unmounted = true;
}
@ -162,9 +162,9 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
}
}
isBusy = () => this.state.busy || this.props.busy;
public isBusy = () => this.state.busy || this.props.busy;
onPasswordLogin = async (username, phoneCountry, phoneNumber, password) => {
public onPasswordLogin = async (username, phoneCountry, phoneNumber, password) => {
if (!this.state.serverIsAlive) {
this.setState({ busy: true });
// Do a quick liveliness check on the URLs
@ -264,11 +264,11 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
);
};
onUsernameChanged = (username) => {
public onUsernameChanged = (username) => {
this.setState({ username: username });
};
onUsernameBlur = async (username) => {
public onUsernameBlur = async (username) => {
const doWellknownLookup = username[0] === "@";
this.setState({
username: username,
@ -315,23 +315,23 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
}
};
onPhoneCountryChanged = (phoneCountry) => {
public onPhoneCountryChanged = (phoneCountry) => {
this.setState({ phoneCountry: phoneCountry });
};
onPhoneNumberChanged = (phoneNumber) => {
public onPhoneNumberChanged = (phoneNumber) => {
this.setState({
phoneNumber: phoneNumber,
});
};
onRegisterClick = (ev) => {
public onRegisterClick = (ev) => {
ev.preventDefault();
ev.stopPropagation();
this.props.onRegisterClick();
};
onTryRegisterClick = (ev) => {
public onTryRegisterClick = (ev) => {
const hasPasswordFlow = this.state.flows?.find((flow) => flow.type === "m.login.password");
const ssoFlow = this.state.flows?.find((flow) => flow.type === "m.login.sso" || flow.type === "m.login.cas");
// If has no password flow but an SSO flow guess that the user wants to register with SSO.
@ -502,7 +502,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
return errorText;
}
renderLoginComponentForFlows() {
public renderLoginComponentForFlows() {
if (!this.state.flows) return null;
// this is the ideal order we want to show the flows in
@ -553,7 +553,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
);
};
render() {
public render() {
const loader =
this.isBusy() && !this.state.busyLoggingIn ? (
<div className="mx_Login_loader">

View file

@ -125,7 +125,7 @@ export default class Registration extends React.Component<IProps, IState> {
// `replaceClient` tracks latest serverConfig to spot when it changes under the async method which fetches flows
private latestServerConfig: ValidatedServerConfig;
constructor(props) {
public constructor(props) {
super(props);
this.state = {
@ -148,13 +148,13 @@ export default class Registration extends React.Component<IProps, IState> {
});
}
componentDidMount() {
public componentDidMount() {
this.replaceClient(this.props.serverConfig);
//triggers a confirmation dialog for data loss before page unloads/refreshes
window.addEventListener("beforeunload", this.unloadCallback);
}
componentWillUnmount() {
public componentWillUnmount() {
window.removeEventListener("beforeunload", this.unloadCallback);
}
@ -565,7 +565,7 @@ export default class Registration extends React.Component<IProps, IState> {
}
}
render() {
public render() {
let errorText;
const err = this.state.errorText;
if (err) {

View file

@ -45,7 +45,7 @@ interface IState {
}
export default class SetupEncryptionBody extends React.Component<IProps, IState> {
constructor(props) {
public constructor(props) {
super(props);
const store = SetupEncryptionStore.sharedInstance();
store.on("update", this.onStoreUpdate);