You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
@ -83,13 +83,8 @@ export default class ReplyThread extends React.Component {
|
|||||||
|
|
||||||
async initialize() {
|
async initialize() {
|
||||||
const {parentEv} = this.props;
|
const {parentEv} = this.props;
|
||||||
const inReplyTo = ReplyThread.getParentEventId(parentEv);
|
// at time of making this component we checked that props.parentEv has a parentEventId
|
||||||
if (!inReplyTo) {
|
const ev = await ReplyThread.getEvent(this.room, ReplyThread.getParentEventId(parentEv));
|
||||||
this.setState({err: true});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ev = await ReplyThread.getEvent(this.room, inReplyTo['event_id']);
|
|
||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
|
|
||||||
if (ev) {
|
if (ev) {
|
||||||
@ -104,16 +99,16 @@ export default class ReplyThread extends React.Component {
|
|||||||
async loadNextEvent() {
|
async loadNextEvent() {
|
||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
const ev = this.state.events[0];
|
const ev = this.state.events[0];
|
||||||
const inReplyTo = ReplyThread.getParentEventId(ev);
|
const inReplyToEventId = ReplyThread.getParentEventId(ev);
|
||||||
|
|
||||||
if (!inReplyTo) {
|
if (!inReplyToEventId) {
|
||||||
this.setState({
|
this.setState({
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadedEv = await ReplyThread.getEvent(this.room, inReplyTo['event_id']);
|
const loadedEv = await ReplyThread.getEvent(this.room, inReplyToEventId);
|
||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
|
|
||||||
if (loadedEv) {
|
if (loadedEv) {
|
||||||
|
Reference in New Issue
Block a user