You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Be more like other arrow functions
This commit is contained in:
@@ -47,7 +47,7 @@ import FilePanel from "./FilePanel";
|
|||||||
import NotificationPanel from "./NotificationPanel";
|
import NotificationPanel from "./NotificationPanel";
|
||||||
import ResizeNotifier from "../../utils/ResizeNotifier";
|
import ResizeNotifier from "../../utils/ResizeNotifier";
|
||||||
import PinnedMessagesCard from "../views/right_panel/PinnedMessagesCard";
|
import PinnedMessagesCard from "../views/right_panel/PinnedMessagesCard";
|
||||||
import { DebouncedFunc, throttle } from 'lodash';
|
import { throttle } from 'lodash';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
room?: Room; // if showing panels for a given room, this is set
|
room?: Room; // if showing panels for a given room, this is set
|
||||||
@@ -73,7 +73,6 @@ interface IState {
|
|||||||
export default class RightPanel extends React.Component<IProps, IState> {
|
export default class RightPanel extends React.Component<IProps, IState> {
|
||||||
static contextType = MatrixClientContext;
|
static contextType = MatrixClientContext;
|
||||||
|
|
||||||
private readonly delayedUpdate: DebouncedFunc<() => void>;
|
|
||||||
private dispatcherRef: string;
|
private dispatcherRef: string;
|
||||||
|
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
@@ -84,12 +83,12 @@ export default class RightPanel extends React.Component<IProps, IState> {
|
|||||||
isUserPrivilegedInGroup: null,
|
isUserPrivilegedInGroup: null,
|
||||||
member: this.getUserForPanel(),
|
member: this.getUserForPanel(),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.delayedUpdate = throttle(() => {
|
|
||||||
this.forceUpdate();
|
|
||||||
}, 500, { leading: true, trailing: true });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly delayedUpdate = throttle((): void => {
|
||||||
|
this.forceUpdate();
|
||||||
|
}, 500, { leading: true, trailing: true });
|
||||||
|
|
||||||
// Helper function to split out the logic for getPhaseFromProps() and the constructor
|
// Helper function to split out the logic for getPhaseFromProps() and the constructor
|
||||||
// as both are called at the same time in the constructor.
|
// as both are called at the same time in the constructor.
|
||||||
private getUserForPanel() {
|
private getUserForPanel() {
|
||||||
|
|||||||
Reference in New Issue
Block a user