Skip to content

Commit

Permalink
Merge pull request #947 from openedx/sundas/INF-1164
Browse files Browse the repository at this point in the history
fix: app level toggle is now disabled during api call
  • Loading branch information
sundasnoreen12 authored Nov 30, 2023
2 parents 4aa44b8 + c0b5047 commit 56d0ad3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/notification-preferences/NotificationPreferenceApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ import {
selectPreferenceAppToggleValue,
selectPreferencesOfApp,
selectSelectedCourseId,
selectUpdatePreferencesStatus,
} from './data/selectors';
import NotificationPreferenceRow from './NotificationPreferenceRow';
import { updateAppPreferenceToggle } from './data/thunks';
import { LOADING_STATUS } from '../constants';

const NotificationPreferenceApp = ({ appId }) => {
const dispatch = useDispatch();
const intl = useIntl();
const courseId = useSelector(selectSelectedCourseId());
const appPreferences = useSelector(selectPreferencesOfApp(appId));
const appToggle = useSelector(selectPreferenceAppToggleValue(appId));
const updatePreferencesStatus = useSelector(selectUpdatePreferencesStatus());

const preferences = useMemo(() => (
appPreferences.map(preference => (
Expand Down Expand Up @@ -49,6 +52,7 @@ const NotificationPreferenceApp = ({ appId }) => {
name={appId}
value={appToggle}
onChange={onChangeAppSettings}
disabled={updatePreferencesStatus === LOADING_STATUS}
/>
</span>
</div>
Expand Down

0 comments on commit 56d0ad3

Please sign in to comment.