You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Adapt threading UI to new backend
This commit is contained in:
@@ -26,12 +26,14 @@ import { MatrixClientPeg } from '../../MatrixClientPeg';
|
||||
import ResizeNotifier from '../../utils/ResizeNotifier';
|
||||
import EventTile from '../views/rooms/EventTile';
|
||||
import MessageComposer from '../views/rooms/MessageComposer';
|
||||
import { RoomPermalinkCreator } from '../../utils/permalinks/Permalinks';
|
||||
|
||||
interface IProps {
|
||||
roomId: string;
|
||||
onClose: () => void;
|
||||
resizeNotifier: ResizeNotifier;
|
||||
mxEvent: MatrixEvent;
|
||||
permalinkCreator?: RoomPermalinkCreator;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
@@ -44,9 +46,18 @@ interface IState {
|
||||
class ThreadView extends React.Component<IProps, IState> {
|
||||
state = {};
|
||||
|
||||
public componentDidMount(): void {}
|
||||
public componentDidMount(): void {
|
||||
// this.props.mxEvent.getThread().on("Thread.update", this.updateThread);
|
||||
this.props.mxEvent.getThread().once("Thread.ready", this.updateThread);
|
||||
}
|
||||
|
||||
public componentWillUnmount(): void {}
|
||||
public componentWillUnmount(): void {
|
||||
this.props.mxEvent.getThread().removeListener("Thread.update", this.updateThread);
|
||||
}
|
||||
|
||||
updateThread = () => {
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
public renderEventTile(event: MatrixEvent): JSX.Element {
|
||||
return <EventTile
|
||||
@@ -59,9 +70,8 @@ class ThreadView extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
public render() {
|
||||
const client = MatrixClientPeg.get();
|
||||
const room = client.getRoom(this.props.roomId);
|
||||
const thread = room.getThread(this.props.mxEvent.getId());
|
||||
const thread = this.props.mxEvent.getThread();
|
||||
const room = MatrixClientPeg.get().getRoom(this.props.roomId);
|
||||
return (
|
||||
<BaseCard
|
||||
className="mx_ThreadView"
|
||||
@@ -80,7 +90,7 @@ class ThreadView extends React.Component<IProps, IState> {
|
||||
room={room}
|
||||
resizeNotifier={this.props.resizeNotifier}
|
||||
replyToEvent={this.props.mxEvent}
|
||||
permalinkCreator={null}
|
||||
permalinkCreator={this.props.permalinkCreator}
|
||||
/>
|
||||
</BaseCard>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user