diff --git a/src/CONST.js b/src/CONST.js index 878d3f858dfb..6f97f127a802 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -586,6 +586,7 @@ const CONST = { MUTE: 'mute', DAILY: 'daily', ALWAYS: 'always', + HIDDEN: 'hidden', }, // Options for which room members can post WRITE_CAPABILITIES: { diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index a3fbb5e41378..a01f1ab8322e 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -68,8 +68,8 @@ function OptionRowLHN(props) { return null; } - const isMuted = optionItem.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE; - if (isMuted && !props.isFocused && !optionItem.isPinned) { + const isHidden = optionItem.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN; + if (isHidden && !props.isFocused && !optionItem.isPinned) { return null; } diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index ade3791fc0c7..8b898a6aaaea 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1544,9 +1544,9 @@ function shouldShowReportActionNotification(reportID, action = null, isRemote = return false; } - // We don't want to send a local notification if the user preference is daily or mute + // We don't want to send a local notification if the user preference is daily, mute or hidden. const notificationPreference = lodashGet(allReports, [reportID, 'notificationPreference'], CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS); - if (notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE || notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY) { + if (notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS) { Log.info(`${tag} No notification because user preference is to be notified: ${notificationPreference}`); return false; } diff --git a/src/pages/settings/Report/ReportSettingsPage.js b/src/pages/settings/Report/ReportSettingsPage.js index b21c4b971dca..c2bd69028a44 100644 --- a/src/pages/settings/Report/ReportSettingsPage.js +++ b/src/pages/settings/Report/ReportSettingsPage.js @@ -65,7 +65,10 @@ function ReportSettingsPage(props) { const shouldDisableSettings = _.isEmpty(report) || ReportUtils.shouldDisableSettings(report) || ReportUtils.isArchivedRoom(report); const shouldShowRoomName = !ReportUtils.isPolicyExpenseChat(report) && !ReportUtils.isChatThread(report); - const notificationPreference = translate(`notificationPreferencesPage.notificationPreferences.${report.notificationPreference}`); + const notificationPreference = + report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN + ? translate(`notificationPreferencesPage.notificationPreferences.${report.notificationPreference}`) + : ''; const writeCapability = ReportUtils.isAdminRoom(report) ? CONST.REPORT.WRITE_CAPABILITIES.ADMINS : report.writeCapability || CONST.REPORT.WRITE_CAPABILITIES.ALL; const writeCapabilityText = translate(`writeCapabilityPage.writeCapability.${writeCapability}`); @@ -79,12 +82,14 @@ function ReportSettingsPage(props) { onBackButtonPress={() => Navigation.goBack(ROUTES.getReportDetailsRoute(report.reportID))} /> - Navigation.navigate(ROUTES.getReportSettingsNotificationPreferencesRoute(report.reportID))} - /> + {report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN && ( + Navigation.navigate(ROUTES.getReportSettingsNotificationPreferencesRoute(report.reportID))} + /> + )} {shouldShowRoomName && (