From c72ee3232f2740f7a4a4356faba91e060ad6326b Mon Sep 17 00:00:00 2001 From: Srikar Parsi Date: Mon, 24 Jul 2023 20:36:41 -0400 Subject: [PATCH] Hide All Muted Chats --- src/components/LHNOptionsList/OptionRowLHN.js | 5 +++++ src/libs/SidebarUtils.js | 1 + 2 files changed, 6 insertions(+) diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index f8c45b585531..8a9f3d9673d8 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -65,6 +65,11 @@ function OptionRowLHN(props) { return null; } + const isMuted = optionItem.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE; + if (isMuted && !props.isFocused && !optionItem.isPinned) { + return null; + } + let popoverAnchor = null; const textStyle = props.isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText; const textUnreadStyle = optionItem.isUnread ? [textStyle, styles.sidebarLinkTextBold] : [textStyle]; diff --git a/src/libs/SidebarUtils.js b/src/libs/SidebarUtils.js index 757ff91834f2..69d7d772403a 100644 --- a/src/libs/SidebarUtils.js +++ b/src/libs/SidebarUtils.js @@ -274,6 +274,7 @@ function getOptionData(report, personalDetails, preferredLocale, policy) { result.tooltipText = ReportUtils.getReportParticipantsTitle(report.participantAccountIDs || []); result.hasOutstandingIOU = report.hasOutstandingIOU; result.parentReportID = report.parentReportID || null; + result.notificationPreference = report.notificationPreference || null; const hasMultipleParticipants = participantPersonalDetailList.length > 1 || result.isChatRoom || result.isPolicyExpenseChat; const subtitle = ReportUtils.getChatRoomSubtitle(report);