From 626d5758207bac8af6fdeeec83d4231a8374ff28 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 16 Jun 2021 12:07:58 +0100 Subject: [PATCH] tidy AuxPanel TS --- src/components/views/rooms/AuxPanel.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/views/rooms/AuxPanel.tsx b/src/components/views/rooms/AuxPanel.tsx index f89390ea25..74609cca13 100644 --- a/src/components/views/rooms/AuxPanel.tsx +++ b/src/components/views/rooms/AuxPanel.tsx @@ -15,18 +15,18 @@ limitations under the License. */ import React from 'react'; -import {MatrixClientPeg} from "../../../MatrixClientPeg"; +import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { Room } from 'matrix-js-sdk/src/models/room' import AppsDrawer from './AppsDrawer'; import classNames from 'classnames'; import RateLimitedFunc from '../../../ratelimitedfunc'; import SettingsStore from "../../../settings/SettingsStore"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; -import {UIFeature} from "../../../settings/UIFeature"; +import { UIFeature } from "../../../settings/UIFeature"; import { ResizeNotifier } from "../../../utils/ResizeNotifier"; import CallViewForRoom from '../voip/CallViewForRoom'; -import {objectHasDiff} from "../../../utils/objects"; -import {replaceableComponent} from "../../../utils/replaceableComponent"; +import { objectHasDiff } from "../../../utils/objects"; +import { replaceableComponent } from "../../../utils/replaceableComponent"; interface IProps { // js-sdk room object @@ -68,21 +68,21 @@ export default class AuxPanel extends React.Component { super(props); this.state = { - counters: this._computeCounters(), + counters: this.computeCounters(), }; } componentDidMount() { const cli = MatrixClientPeg.get(); if (SettingsStore.getValue("feature_state_counters")) { - cli.on("RoomState.events", this._rateLimitedUpdate); + cli.on("RoomState.events", this.rateLimitedUpdate); } } componentWillUnmount() { const cli = MatrixClientPeg.get(); if (cli && SettingsStore.getValue("feature_state_counters")) { - cli.removeListener("RoomState.events", this._rateLimitedUpdate); + cli.removeListener("RoomState.events", this.rateLimitedUpdate); } } @@ -97,11 +97,11 @@ export default class AuxPanel extends React.Component { } } - _rateLimitedUpdate = new RateLimitedFunc(() => { - this.setState({ counters: this._computeCounters() }); + private rateLimitedUpdate = new RateLimitedFunc(() => { + this.setState({ counters: this.computeCounters() }); }, 500); - _computeCounters() { + private computeCounters() { const counters = []; if (this.props.room && SettingsStore.getValue("feature_state_counters")) {