@@ -1395,15 +1395,17 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
13951395 return b . length - a . length ;
13961396 } ) ;
13971397
1398- // Process all thread roots returned in this batch of search results
1399- // XXX: This won't work for results coming from Seshat which won't include the bundled relationship
1400- for ( const result of results . results ) {
1401- for ( const event of result . context . getTimeline ( ) ) {
1402- const bundledRelationship = event
1403- . getServerAggregatedRelation < IThreadBundledRelationship > ( THREAD_RELATION_TYPE . name ) ;
1404- if ( ! bundledRelationship || event . getThread ( ) ) continue ;
1405- const room = this . context . getRoom ( event . getRoomId ( ) ) ;
1406- event . setThread ( room . findThreadForEvent ( event ) ?? room . createThread ( event , [ ] , true ) ) ;
1398+ if ( this . context . supportsExperimentalThreads ( ) ) {
1399+ // Process all thread roots returned in this batch of search results
1400+ // XXX: This won't work for results coming from Seshat which won't include the bundled relationship
1401+ for ( const result of results . results ) {
1402+ for ( const event of result . context . getTimeline ( ) ) {
1403+ const bundledRelationship = event
1404+ . getServerAggregatedRelation < IThreadBundledRelationship > ( THREAD_RELATION_TYPE . name ) ;
1405+ if ( ! bundledRelationship || event . getThread ( ) ) continue ;
1406+ const room = this . context . getRoom ( event . getRoomId ( ) ) ;
1407+ event . setThread ( room . findThreadForEvent ( event ) ?? room . createThread ( event , [ ] , true ) ) ;
1408+ }
14071409 }
14081410 }
14091411
0 commit comments