mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Stop tracking threads if threads support is disabled (#8308)
This commit is contained in:
parent
a59f889f79
commit
d151365fd7
2 changed files with 12 additions and 10 deletions
|
@ -1395,15 +1395,17 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
return b.length - a.length;
|
||||
});
|
||||
|
||||
// Process all thread roots returned in this batch of search results
|
||||
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
|
||||
for (const result of results.results) {
|
||||
for (const event of result.context.getTimeline()) {
|
||||
const bundledRelationship = event
|
||||
.getServerAggregatedRelation<IThreadBundledRelationship>(THREAD_RELATION_TYPE.name);
|
||||
if (!bundledRelationship || event.getThread()) continue;
|
||||
const room = this.context.getRoom(event.getRoomId());
|
||||
event.setThread(room.findThreadForEvent(event) ?? room.createThread(event, [], true));
|
||||
if (this.context.supportsExperimentalThreads()) {
|
||||
// Process all thread roots returned in this batch of search results
|
||||
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
|
||||
for (const result of results.results) {
|
||||
for (const event of result.context.getTimeline()) {
|
||||
const bundledRelationship = event
|
||||
.getServerAggregatedRelation<IThreadBundledRelationship>(THREAD_RELATION_TYPE.name);
|
||||
if (!bundledRelationship || event.getThread()) continue;
|
||||
const room = this.context.getRoom(event.getRoomId());
|
||||
event.setThread(room.findThreadForEvent(event) ?? room.createThread(event, [], true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ export async function fetchInitialEvent(
|
|||
initialEvent = null;
|
||||
}
|
||||
|
||||
if (initialEvent?.isThreadRelation) {
|
||||
if (initialEvent?.isThreadRelation && client.supportsExperimentalThreads()) {
|
||||
try {
|
||||
const rootEventData = await client.fetchRoomEvent(roomId, initialEvent.threadRootId);
|
||||
const rootEvent = new MatrixEvent(rootEventData);
|
||||
|
|
Loading…
Reference in a new issue