diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index b7275e5074..259d2aa5b8 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -55,7 +55,6 @@ import {ActionPayload} from "../../../dispatcher/payloads"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; import { NotificationState } from "../../../stores/notifications/NotificationState"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; -import { objectDiff, objectHasValueChange } from "../../../utils/objects"; interface IProps { room: Room; @@ -110,7 +109,7 @@ const NotifOption: React.FC = ({active, onClick, iconClassNam ); }; -export default class RoomTile extends React.Component { +export default class RoomTile extends React.PureComponent { private dispatcherRef: string; private roomTileRef = createRef(); @@ -155,22 +154,6 @@ export default class RoomTile extends React.Component { MessagePreviewStore.instance.off(ROOM_PREVIEW_CHANGED, this.onRoomPreviewChanged); } - public shouldComponentUpdate(nextProps: Readonly, nextState: Readonly): boolean { - // Whenever a prop change happens (or our parent updates) we can get told to update too. Try - // to minimize that by seeing if anything actually changed. - if (objectHasValueChange(this.props, nextProps)) { - return true; - } - - // Do the same for state - if (objectHasValueChange(this.state, nextState)) { - return true; - } - - // Finally, nothing changed so say so. - return false; - } - private onAction = (payload: ActionPayload) => { if (payload.action === "view_room" && payload.room_id === this.props.room.roomId && payload.show_room_tile) { setImmediate(() => {