1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Improve thread deduplication thread process

Some threads were still holding a reference to the original thread models they were assigned to, leading to some unexpected timeline rendering
This commit is contained in:
Germain Souquet
2021-09-07 15:05:45 +01:00
parent 324f9e58ea
commit e97d18a03b
4 changed files with 51 additions and 20 deletions

View File

@@ -412,9 +412,12 @@ export class MatrixEvent extends EventEmitter {
* or in the main room timeline
*/
public get replyInThread(): boolean {
const relations = this.getWireContent()["m.relates_to"];
return this.replyEventId
&& relations[UNSTABLE_ELEMENT_REPLY_IN_THREAD.name];
const replyTo = this.getWireContent()
?.["m.relates_to"]
?.["m.in_reply_to"];
return (this.replyEventId
&& replyTo[UNSTABLE_ELEMENT_REPLY_IN_THREAD.name])
|| this.thread instanceof Thread;
}
/**