Skip to content

Commit

Permalink
fix: Making sure email setting modal opens after being closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
zwidekalanga committed Aug 12, 2024
1 parent 8d4a976 commit ef87499
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const getScreenReaderText = (str) => (
);

const BaseCourseCard = ({
hasEmailsEnabled: defaultHasEmailsEnabled,
hasEmailsEnabled,
title,
dropdownMenuItems: customDropdownMenuItem,
canUnenroll,
Expand All @@ -148,7 +148,6 @@ const BaseCourseCard = ({
const intl = useIntl();
const { LEARNER_SUPPORT_PACED_COURSE_MODE_URL } = getConfig();
const { data: enterpriseCustomer } = useEnterpriseCustomer();
const [hasEmailsEnabled, setHasEmailsEnabled] = useState(defaultHasEmailsEnabled);
const [emailSettingsModal, setEmailSettingsModal] = useState({
open: false,
options: {},
Expand Down Expand Up @@ -267,11 +266,8 @@ const BaseCourseCard = ({
}));
};

const handleEmailSettingsModalOnClose = (newValue) => {
const handleEmailSettingsModalOnClose = () => {
resetModals();
if (hasEmailsEnabled !== undefined) {
setHasEmailsEnabled(newValue);
}
};

const handleUnenrollModalOnClose = () => {
Expand Down

0 comments on commit ef87499

Please sign in to comment.