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

Commit

Permalink
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
Browse files Browse the repository at this point in the history
… t3chguy/fix/npe1
  • Loading branch information
t3chguy committed Sep 17, 2021
2 parents 1e91191 + 58ffa51 commit 80caa56
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/structures/EmbeddedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
};
}

private translate(s: string): string {
protected translate(s: string): string {
// default implementation - skins may wish to extend this
return sanitizeHtml(_t(s));
}
Expand Down
9 changes: 4 additions & 5 deletions src/components/structures/LegacyCommunityPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { linkifyElement } from "../../HtmlUtils";
import defaultDispatcher from "../../dispatcher/dispatcher";
import { Action } from "../../dispatcher/actions";
import { UserTab } from "../views/dialogs/UserSettingsDialog";
import MainSplit from './MainSplit';

interface IProps {
groupId: string;
Expand All @@ -49,11 +48,11 @@ const LegacyCommunityPreview = ({ groupId }: IProps) => {

if (!groupSummary) {
return <main className="mx_SpaceRoomView">
<MainSplit>
<div className="mx_MainSplit">
<div className="mx_SpaceRoomView_preview">
<Spinner />
</div>
</MainSplit>
</div>
</main>;
}

Expand All @@ -70,7 +69,7 @@ const LegacyCommunityPreview = ({ groupId }: IProps) => {

return <main className="mx_SpaceRoomView">
<ErrorBoundary>
<MainSplit>
<div className="mx_MainSplit">
<div className="mx_SpaceRoomView_preview">
<GroupAvatar
groupId={groupId}
Expand Down Expand Up @@ -108,7 +107,7 @@ const LegacyCommunityPreview = ({ groupId }: IProps) => {
}
</div>
</div>
</MainSplit>
</div>
</ErrorBoundary>
</main>;
};
Expand Down
10 changes: 5 additions & 5 deletions src/components/structures/ThreadPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

import React from 'react';
import { MatrixEvent, Room } from 'matrix-js-sdk/src';
import { Thread } from 'matrix-js-sdk/src/models/thread';
import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread';

import BaseCard from "../views/right_panel/BaseCard";
import { RightPanelPhases } from "../../stores/RightPanelStorePhases";
Expand Down Expand Up @@ -46,13 +46,13 @@ export default class ThreadPanel extends React.Component<IProps, IState> {
}

public componentDidMount(): void {
this.room.on("Thread.update", this.onThreadEventReceived);
this.room.on("Thread.ready", this.onThreadEventReceived);
this.room.on(ThreadEvent.Update, this.onThreadEventReceived);
this.room.on(ThreadEvent.Ready, this.onThreadEventReceived);
}

public componentWillUnmount(): void {
this.room.removeListener("Thread.update", this.onThreadEventReceived);
this.room.removeListener("Thread.ready", this.onThreadEventReceived);
this.room.removeListener(ThreadEvent.Update, this.onThreadEventReceived);
this.room.removeListener(ThreadEvent.Ready, this.onThreadEventReceived);
}

private onThreadEventReceived = () => this.updateThreads();
Expand Down
10 changes: 5 additions & 5 deletions src/components/structures/ThreadView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

import React from 'react';
import { MatrixEvent, Room } from 'matrix-js-sdk/src';
import { Thread } from 'matrix-js-sdk/src/models/thread';
import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread';

import BaseCard from "../views/right_panel/BaseCard";
import { RightPanelPhases } from "../../stores/RightPanelStorePhases";
Expand Down Expand Up @@ -99,15 +99,15 @@ export default class ThreadView extends React.Component<IProps, IState> {
thread = new Thread([mxEv], this.props.room, client);
mxEv.setThread(thread);
}
thread.on("Thread.update", this.updateThread);
thread.once("Thread.ready", this.updateThread);
thread.on(ThreadEvent.Update, this.updateThread);
thread.once(ThreadEvent.Ready, this.updateThread);
this.updateThread(thread);
};

private teardownThread = () => {
if (this.state.thread) {
this.state.thread.removeListener("Thread.update", this.updateThread);
this.state.thread.removeListener("Thread.ready", this.updateThread);
this.state.thread.removeListener(ThreadEvent.Update, this.updateThread);
this.state.thread.removeListener(ThreadEvent.Ready, this.updateThread);
}
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/views/rooms/EventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { EventType } from "matrix-js-sdk/src/@types/event";
import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Relations } from "matrix-js-sdk/src/models/relations";
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
import { Thread } from 'matrix-js-sdk/src/models/thread';
import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread';

import ReplyThread from "../elements/ReplyThread";
import { _t } from '../../../languageHandler';
Expand Down Expand Up @@ -464,8 +464,8 @@ export default class EventTile extends React.Component<IProps, IState> {
}

if (SettingsStore.getValue("feature_thread")) {
this.props.mxEvent.once("Thread.ready", this.updateThread);
this.props.mxEvent.on("Thread.update", this.updateThread);
this.props.mxEvent.once(ThreadEvent.Ready, this.updateThread);
this.props.mxEvent.on(ThreadEvent.Update, this.updateThread);
}
}

Expand Down

0 comments on commit 80caa56

Please sign in to comment.