Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7cce8a3

Browse files
authored
Merge pull request #5321 from matrix-org/travis/fix-line
Fix/clarify boolean logic for reaction previews
2 parents f60dff5 + dccea97 commit 7cce8a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/stores/room-list/previews/ReactionEventPreview.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ export class ReactionEventPreview implements IPreview {
2727
const showDms = SettingsStore.getValue("feature_roomlist_preview_reactions_dms");
2828
const showAll = SettingsStore.getValue("feature_roomlist_preview_reactions_all");
2929

30-
if (!showAll && (!showDms || DMRoomMap.shared().getUserIdForRoomId(event.getRoomId()))) return null;
30+
// If we're not showing all reactions, see if we're showing DMs instead
31+
if (!showAll) {
32+
// If we're not showing reactions on DMs, or we are and the room isn't a DM, skip
33+
if (!(showDms && DMRoomMap.shared().getUserIdForRoomId(event.getRoomId()))) {
34+
return null;
35+
}
36+
}
3137

3238
const relation = event.getRelation();
3339
if (!relation) return null; // invalid reaction (probably redacted)

0 commit comments

Comments
 (0)