You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Fix thread creation
This commit is contained in:
@@ -32,6 +32,7 @@ import dis from "../../dispatcher/dispatcher";
|
|||||||
import { ActionPayload } from '../../dispatcher/payloads';
|
import { ActionPayload } from '../../dispatcher/payloads';
|
||||||
import { SetRightPanelPhasePayload } from '../../dispatcher/payloads/SetRightPanelPhasePayload';
|
import { SetRightPanelPhasePayload } from '../../dispatcher/payloads/SetRightPanelPhasePayload';
|
||||||
import { Action } from '../../dispatcher/actions';
|
import { Action } from '../../dispatcher/actions';
|
||||||
|
import { MatrixClientPeg } from '../../MatrixClientPeg';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
room: Room;
|
room: Room;
|
||||||
@@ -89,12 +90,15 @@ export default class ThreadView extends React.Component<IProps, IState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private setupThread = (mxEv: MatrixEvent) => {
|
private setupThread = (mxEv: MatrixEvent) => {
|
||||||
const thread = mxEv.getThread();
|
let thread = mxEv.getThread();
|
||||||
if (thread) {
|
if (!thread) {
|
||||||
|
const client = MatrixClientPeg.get();
|
||||||
|
thread = new Thread([mxEv], this.props.room, client);
|
||||||
|
mxEv.setThread(thread);
|
||||||
|
}
|
||||||
thread.on("Thread.update", this.updateThread);
|
thread.on("Thread.update", this.updateThread);
|
||||||
thread.once("Thread.ready", this.updateThread);
|
thread.once("Thread.ready", this.updateThread);
|
||||||
this.updateThread(thread);
|
this.updateThread(thread);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private teardownThread = () => {
|
private teardownThread = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user