From 6bcf9540b8904c8d93f2ec64ac9e6abe9a7fe56e Mon Sep 17 00:00:00 2001 From: ra-md Date: Thu, 1 Aug 2024 01:52:29 +0700 Subject: [PATCH 1/2] Show FullPageNotFoundView when notification preference is set to hidden --- src/pages/settings/Report/NotificationPreferencePage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Report/NotificationPreferencePage.tsx b/src/pages/settings/Report/NotificationPreferencePage.tsx index 9e50644cce99..4daf703513c0 100644 --- a/src/pages/settings/Report/NotificationPreferencePage.tsx +++ b/src/pages/settings/Report/NotificationPreferencePage.tsx @@ -21,7 +21,8 @@ type NotificationPreferencePageProps = WithReportOrNotFoundProps & StackScreenPr function NotificationPreferencePage({report}: NotificationPreferencePageProps) { const {translate} = useLocalize(); const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID || -1}`); - const shouldDisableNotificationPreferences = ReportUtils.isArchivedRoom(report, reportNameValuePairs) || ReportUtils.isSelfDM(report); + const shouldDisableNotificationPreferences = + ReportUtils.isArchivedRoom(report, reportNameValuePairs) || ReportUtils.isSelfDM(report) || report?.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN; const notificationPreferenceOptions = Object.values(CONST.REPORT.NOTIFICATION_PREFERENCE) .filter((pref) => pref !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) .map((preference) => ({ From f478c8fb0bb7d7c3b902abf5e2cda77b4da40723 Mon Sep 17 00:00:00 2001 From: ra-md Date: Thu, 1 Aug 2024 18:13:21 +0700 Subject: [PATCH 2/2] prevent notification preferences from being disabled for money request reports --- src/pages/settings/Report/NotificationPreferencePage.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Report/NotificationPreferencePage.tsx b/src/pages/settings/Report/NotificationPreferencePage.tsx index 4daf703513c0..186419ca3363 100644 --- a/src/pages/settings/Report/NotificationPreferencePage.tsx +++ b/src/pages/settings/Report/NotificationPreferencePage.tsx @@ -21,8 +21,11 @@ type NotificationPreferencePageProps = WithReportOrNotFoundProps & StackScreenPr function NotificationPreferencePage({report}: NotificationPreferencePageProps) { const {translate} = useLocalize(); const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID || -1}`); + const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); const shouldDisableNotificationPreferences = - ReportUtils.isArchivedRoom(report, reportNameValuePairs) || ReportUtils.isSelfDM(report) || report?.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN; + ReportUtils.isArchivedRoom(report, reportNameValuePairs) || + ReportUtils.isSelfDM(report) || + (!isMoneyRequestReport && report?.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN); const notificationPreferenceOptions = Object.values(CONST.REPORT.NOTIFICATION_PREFERENCE) .filter((pref) => pref !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) .map((preference) => ({