Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a794bfd

Browse files
authored
Merge pull request #5665 from matrix-org/t3chguy/spaces1
Discard some dead code
2 parents de7e2ed + 49f511b commit a794bfd

File tree

13 files changed

+15
-395
lines changed

13 files changed

+15
-395
lines changed

src/ObjectUtils.js

Lines changed: 0 additions & 113 deletions
This file was deleted.

src/PhasedRollOut.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/components/structures/RoomView.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import CallHandler from '../../CallHandler';
3838
import dis from '../../dispatcher/dispatcher';
3939
import Tinter from '../../Tinter';
4040
import rateLimitedFunc from '../../ratelimitedfunc';
41-
import * as ObjectUtils from '../../ObjectUtils';
4241
import * as Rooms from '../../Rooms';
4342
import eventSearch, { searchPagination } from '../../Searching';
4443
import { isOnlyCtrlOrCmdIgnoreShiftKeyEvent, Key } from '../../Keyboard';
@@ -80,6 +79,7 @@ import Notifier from "../../Notifier";
8079
import { showToast as showNotificationsToast } from "../../toasts/DesktopNotificationsToast";
8180
import { RoomNotificationStateStore } from "../../stores/notifications/RoomNotificationStateStore";
8281
import { Container, WidgetLayoutStore } from "../../stores/widgets/WidgetLayoutStore";
82+
import { objectHasDiff } from "../../utils/objects";
8383

8484
const DEBUG = false;
8585
let debuglog = function(msg: string) {};
@@ -523,8 +523,7 @@ export default class RoomView extends React.Component<IProps, IState> {
523523
}
524524

525525
shouldComponentUpdate(nextProps, nextState) {
526-
return (!ObjectUtils.shallowEqual(this.props, nextProps) ||
527-
!ObjectUtils.shallowEqual(this.state, nextState));
526+
return (objectHasDiff(this.props, nextProps) || objectHasDiff(this.state, nextState));
528527
}
529528

530529
componentDidUpdate() {

src/components/structures/TimelinePanel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {EventTimeline} from "matrix-js-sdk";
2626
import * as Matrix from "matrix-js-sdk";
2727
import { _t } from '../../languageHandler';
2828
import {MatrixClientPeg} from "../../MatrixClientPeg";
29-
import * as ObjectUtils from "../../ObjectUtils";
3029
import UserActivity from "../../UserActivity";
3130
import Modal from "../../Modal";
3231
import dis from "../../dispatcher/dispatcher";
@@ -37,6 +36,7 @@ import shouldHideEvent from '../../shouldHideEvent';
3736
import EditorStateTransfer from '../../utils/EditorStateTransfer';
3837
import {haveTileForEvent} from "../views/rooms/EventTile";
3938
import {UIFeature} from "../../settings/UIFeature";
39+
import {objectHasDiff} from "../../utils/objects";
4040

4141
const PAGINATE_SIZE = 20;
4242
const INITIAL_SIZE = 20;
@@ -261,7 +261,7 @@ class TimelinePanel extends React.Component {
261261
}
262262

263263
shouldComponentUpdate(nextProps, nextState) {
264-
if (!ObjectUtils.shallowEqual(this.props, nextProps)) {
264+
if (objectHasDiff(this.props, nextProps)) {
265265
if (DEBUG) {
266266
console.group("Timeline.shouldComponentUpdate: props change");
267267
console.log("props before:", this.props);
@@ -271,7 +271,7 @@ class TimelinePanel extends React.Component {
271271
return true;
272272
}
273273

274-
if (!ObjectUtils.shallowEqual(this.state, nextState)) {
274+
if (objectHasDiff(this.state, nextState)) {
275275
if (DEBUG) {
276276
console.group("Timeline.shouldComponentUpdate: state change");
277277
console.log("state before:", this.state);

src/components/views/elements/RoomDirectoryButton.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/components/views/elements/StartChatButton.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/components/views/elements/TintableSvgButton.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/components/views/rooms/AuxPanel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {MatrixClientPeg} from "../../../MatrixClientPeg";
1919
import { Room } from 'matrix-js-sdk/src/models/room'
2020
import * as sdk from '../../../index';
2121
import dis from "../../../dispatcher/dispatcher";
22-
import * as ObjectUtils from '../../../ObjectUtils';
2322
import AppsDrawer from './AppsDrawer';
2423
import { _t } from '../../../languageHandler';
2524
import classNames from 'classnames';
@@ -29,6 +28,7 @@ import AutoHideScrollbar from "../../structures/AutoHideScrollbar";
2928
import {UIFeature} from "../../../settings/UIFeature";
3029
import { ResizeNotifier } from "../../../utils/ResizeNotifier";
3130
import CallViewForRoom from '../voip/CallViewForRoom';
31+
import {objectHasDiff} from "../../../utils/objects";
3232

3333
interface IProps {
3434
// js-sdk room object
@@ -89,8 +89,7 @@ export default class AuxPanel extends React.Component<IProps, IState> {
8989
}
9090

9191
shouldComponentUpdate(nextProps, nextState) {
92-
return (!ObjectUtils.shallowEqual(this.props, nextProps) ||
93-
!ObjectUtils.shallowEqual(this.state, nextState));
92+
return objectHasDiff(this.props, nextProps) || objectHasDiff(this.state, nextState);
9493
}
9594

9695
componentDidUpdate(prevProps, prevState) {

0 commit comments

Comments
 (0)