Switch to using stable values for threads (#8019)

This commit is contained in:
Germain 2022-03-11 09:04:22 +00:00 committed by GitHub
parent d38a1fa201
commit 21d3cb08a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 49 additions and 47 deletions

View file

@ -19,8 +19,9 @@ import classNames from 'classnames';
import { IEventRelation, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/models/room";
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
import { EventType, RelationType } from 'matrix-js-sdk/src/@types/event';
import { EventType } from 'matrix-js-sdk/src/@types/event';
import { Optional } from "matrix-events-sdk";
import { THREAD_RELATION_TYPE } from 'matrix-js-sdk/src/models/thread';
import { _t } from '../../../languageHandler';
import { MatrixClientPeg } from '../../../MatrixClientPeg';
@ -258,7 +259,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
private renderPlaceholderText = () => {
if (this.props.replyToEvent) {
const replyingToThread = this.props.relation?.rel_type === RelationType.Thread;
const replyingToThread = this.props.relation?.rel_type === THREAD_RELATION_TYPE.name;
if (replyingToThread && this.props.e2eStatus) {
return _t('Reply to encrypted thread…');
} else if (replyingToThread) {
@ -426,7 +427,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
/>;
}
const threadId = this.props.relation?.rel_type === RelationType.Thread
const threadId = this.props.relation?.rel_type === THREAD_RELATION_TYPE.name
? this.props.relation.event_id
: null;