refactor: rename selector
This commit is contained in:
@@ -11,13 +11,13 @@ import { useIsOnMobile } from '../hooks';
|
||||
import NotificationTypes from './NotificationTypes';
|
||||
import { notificationChannels, shouldHideAppPreferences } from './data/utils';
|
||||
import NotificationPreferenceColumn from './NotificationPreferenceColumn';
|
||||
import { selectPreferenceAppToggleValue, selectSelectedCourseId, selectPreferencesOfApp } from './data/selectors';
|
||||
import { selectPreferenceAppToggleValue, selectSelectedCourseId, selectAppPreferences } from './data/selectors';
|
||||
|
||||
const NotificationPreferenceApp = ({ appId }) => {
|
||||
const intl = useIntl();
|
||||
const courseId = useSelector(selectSelectedCourseId());
|
||||
const appToggle = useSelector(selectPreferenceAppToggleValue(appId));
|
||||
const appPreferences = useSelector(selectPreferencesOfApp(appId));
|
||||
const appPreferences = useSelector(selectAppPreferences(appId));
|
||||
const mobileView = useIsOnMobile();
|
||||
const NOTIFICATION_CHANNELS = notificationChannels();
|
||||
const hideAppPreferences = shouldHideAppPreferences(appPreferences, appId) || false;
|
||||
|
||||
@@ -14,7 +14,7 @@ import EmailCadences from './EmailCadences';
|
||||
import { LOADING_STATUS } from '../constants';
|
||||
import { updateChannelPreferenceToggle, updatePreferenceToggle } from './data/thunks';
|
||||
import {
|
||||
selectNonEditablePreferences, selectPreferencesOfApp, selectSelectedCourseId, selectUpdatePreferencesStatus,
|
||||
selectNonEditablePreferences, selectAppPreferences, selectSelectedCourseId, selectUpdatePreferencesStatus,
|
||||
} from './data/selectors';
|
||||
import { notificationChannels, shouldHideAppPreferences } from './data/utils';
|
||||
|
||||
@@ -22,7 +22,7 @@ const NotificationPreferenceColumn = ({ appId, channel, appPreference }) => {
|
||||
const dispatch = useDispatch();
|
||||
const intl = useIntl();
|
||||
const courseId = useSelector(selectSelectedCourseId());
|
||||
const appPreferences = useSelector(selectPreferencesOfApp(appId));
|
||||
const appPreferences = useSelector(selectAppPreferences(appId));
|
||||
const nonEditable = useSelector(selectNonEditablePreferences(appId));
|
||||
const updatePreferencesStatus = useSelector(selectUpdatePreferencesStatus());
|
||||
const mobileView = useIsOnMobile();
|
||||
|
||||
@@ -11,12 +11,12 @@ import messages from './messages';
|
||||
import { useIsOnMobile } from '../hooks';
|
||||
import { notificationChannels } from './data/utils';
|
||||
|
||||
import { selectPreferencesOfApp } from './data/selectors';
|
||||
import { selectAppPreferences } from './data/selectors';
|
||||
import NotificationPreferenceColumn from './NotificationPreferenceColumn';
|
||||
|
||||
const NotificationTypes = ({ appId }) => {
|
||||
const intl = useIntl();
|
||||
const preferences = useSelector(selectPreferencesOfApp(appId));
|
||||
const preferences = useSelector(selectAppPreferences(appId));
|
||||
const mobileView = useIsOnMobile();
|
||||
const NOTIFICATION_CHANNELS = notificationChannels();
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export const selectPreferenceAppsId = () => state => (
|
||||
state.notificationPreferences.preferences.apps.map(app => app.id)
|
||||
);
|
||||
|
||||
export const selectPreferencesOfApp = appId => state => (
|
||||
export const selectAppPreferences = appId => state => (
|
||||
selectPreferences()(state).filter(preference => (
|
||||
preference.appId === appId
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user