From 36f7c939e5f2b2e4a4c1245a0d73ac0afe49eab1 Mon Sep 17 00:00:00 2001 From: eemaanamir Date: Wed, 24 Jan 2024 15:53:09 +0500 Subject: [PATCH] refactor: further simplified onChannelToggle --- src/notification-preferences/NotificationPreferenceApp.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/notification-preferences/NotificationPreferenceApp.jsx b/src/notification-preferences/NotificationPreferenceApp.jsx index 6eaddfb98..3ca9f98a2 100644 --- a/src/notification-preferences/NotificationPreferenceApp.jsx +++ b/src/notification-preferences/NotificationPreferenceApp.jsx @@ -29,8 +29,7 @@ const NotificationPreferenceApp = ({ appId }) => { const onChannelToggle = useCallback((event) => { const { id: notificationChannel } = event.target; - const isPreferenceNonEditable = (preference) => nonEditable?.[preference.id]?.includes(notificationChannel) - || false; + const isPreferenceNonEditable = (preference) => nonEditable?.[preference.id]?.includes(notificationChannel); const activePreferences = appPreferences.filter( (preference) => preference[notificationChannel] && !isPreferenceNonEditable(preference),