mirror of https://github.com/vector-im/riot-web
Stop tracking threads if threads support is disabled (#8308)
parent
a59f889f79
commit
d151365fd7
|
@ -1395,15 +1395,17 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||||
return b.length - a.length;
|
return b.length - a.length;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Process all thread roots returned in this batch of search results
|
if (this.context.supportsExperimentalThreads()) {
|
||||||
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
|
// Process all thread roots returned in this batch of search results
|
||||||
for (const result of results.results) {
|
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
|
||||||
for (const event of result.context.getTimeline()) {
|
for (const result of results.results) {
|
||||||
const bundledRelationship = event
|
for (const event of result.context.getTimeline()) {
|
||||||
.getServerAggregatedRelation<IThreadBundledRelationship>(THREAD_RELATION_TYPE.name);
|
const bundledRelationship = event
|
||||||
if (!bundledRelationship || event.getThread()) continue;
|
.getServerAggregatedRelation<IThreadBundledRelationship>(THREAD_RELATION_TYPE.name);
|
||||||
const room = this.context.getRoom(event.getRoomId());
|
if (!bundledRelationship || event.getThread()) continue;
|
||||||
event.setThread(room.findThreadForEvent(event) ?? room.createThread(event, [], true));
|
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;
|
initialEvent = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (initialEvent?.isThreadRelation) {
|
if (initialEvent?.isThreadRelation && client.supportsExperimentalThreads()) {
|
||||||
try {
|
try {
|
||||||
const rootEventData = await client.fetchRoomEvent(roomId, initialEvent.threadRootId);
|
const rootEventData = await client.fetchRoomEvent(roomId, initialEvent.threadRootId);
|
||||||
const rootEvent = new MatrixEvent(rootEventData);
|
const rootEvent = new MatrixEvent(rootEventData);
|
||||||
|
|
Loading…
Reference in New Issue