diff --git a/src/stores/room-list/MessagePreviewStore.ts b/src/stores/room-list/MessagePreviewStore.ts index 51e413940d..e626bca50c 100644 --- a/src/stores/room-list/MessagePreviewStore.ts +++ b/src/stores/room-list/MessagePreviewStore.ts @@ -31,6 +31,7 @@ import { ReactionEventPreview } from "./previews/ReactionEventPreview"; import { UPDATE_EVENT } from "../AsyncStore"; import { type IPreview } from "./previews/IPreview"; import shouldHideEvent from "../../shouldHideEvent"; +import SettingsStore from "../../settings/SettingsStore"; // Emitted event for when a room's preview has changed. First argument will the room for which // the change happened. @@ -178,11 +179,14 @@ export class MessagePreviewStore extends AsyncStoreWithClient { private async generatePreview(room: Room, tagId?: TagID): Promise { const events = [...room.getLiveTimeline().getEvents(), ...room.getPendingEvents()]; - // add last reply from each thread - room.getThreads().forEach((thread: Thread): void => { - const lastReply = thread.lastReply(); - if (lastReply) events.push(lastReply); - }); + const isNewRoomListEnabled = SettingsStore.getValue("feature_new_room_list"); + if (!isNewRoomListEnabled) { + // add last reply from each thread + room.getThreads().forEach((thread: Thread): void => { + const lastReply = thread.lastReply(); + if (lastReply) events.push(lastReply); + }); + } // sort events from oldest to newest events.sort((a: MatrixEvent, b: MatrixEvent) => {