File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import { ReactionEventPreview } from "./previews/ReactionEventPreview";
3131import { UPDATE_EVENT } from "../AsyncStore" ;
3232import { type IPreview } from "./previews/IPreview" ;
3333import shouldHideEvent from "../../shouldHideEvent" ;
34+ import SettingsStore from "../../settings/SettingsStore" ;
3435
3536// Emitted event for when a room's preview has changed. First argument will the room for which
3637// the change happened.
@@ -178,11 +179,14 @@ export class MessagePreviewStore extends AsyncStoreWithClient<EmptyObject> {
178179 private async generatePreview ( room : Room , tagId ?: TagID ) : Promise < void > {
179180 const events = [ ...room . getLiveTimeline ( ) . getEvents ( ) , ...room . getPendingEvents ( ) ] ;
180181
181- // add last reply from each thread
182- room . getThreads ( ) . forEach ( ( thread : Thread ) : void => {
183- const lastReply = thread . lastReply ( ) ;
184- if ( lastReply ) events . push ( lastReply ) ;
185- } ) ;
182+ const isNewRoomListEnabled = SettingsStore . getValue ( "feature_new_room_list" ) ;
183+ if ( ! isNewRoomListEnabled ) {
184+ // add last reply from each thread
185+ room . getThreads ( ) . forEach ( ( thread : Thread ) : void => {
186+ const lastReply = thread . lastReply ( ) ;
187+ if ( lastReply ) events . push ( lastReply ) ;
188+ } ) ;
189+ }
186190
187191 // sort events from oldest to newest
188192 events . sort ( ( a : MatrixEvent , b : MatrixEvent ) => {
You can’t perform that action at this time.
0 commit comments