From dccea9776233bbd8c11d30a2a0d6e0e7d0b5a197 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 14 Oct 2020 08:56:08 -0600 Subject: [PATCH] Fix/clarify boolean logic for reaction previews --- src/stores/room-list/previews/ReactionEventPreview.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/stores/room-list/previews/ReactionEventPreview.ts b/src/stores/room-list/previews/ReactionEventPreview.ts index 95cdc01c66..0012cf2f75 100644 --- a/src/stores/room-list/previews/ReactionEventPreview.ts +++ b/src/stores/room-list/previews/ReactionEventPreview.ts @@ -27,7 +27,13 @@ export class ReactionEventPreview implements IPreview { const showDms = SettingsStore.getValue("feature_roomlist_preview_reactions_dms"); const showAll = SettingsStore.getValue("feature_roomlist_preview_reactions_all"); - if (!showAll && (!showDms || DMRoomMap.shared().getUserIdForRoomId(event.getRoomId()))) return null; + // If we're not showing all reactions, see if we're showing DMs instead + if (!showAll) { + // If we're not showing reactions on DMs, or we are and the room isn't a DM, skip + if (!(showDms && DMRoomMap.shared().getUserIdForRoomId(event.getRoomId()))) { + return null; + } + } const relation = event.getRelation(); if (!relation) return null; // invalid reaction (probably redacted)