Skip to content

Commit

Permalink
refactor: use current section for highlights modal
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Dec 8, 2023
1 parent 6c93229 commit 0ae0442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/course-outline/highlights-modal/HighlightsModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useSelector } from 'react-redux';

import { useHelpUrls } from '../../help-urls/hooks';
import FormikControl from '../../generic/FormikControl';
import { getCurrentItem } from '../data/selectors';
import { getCurrentSection } from '../data/selectors';
import { HIGHLIGHTS_FIELD_MAX_LENGTH } from '../constants';
import { getHighlightsFormValues } from '../utils';
import messages from './messages';
Expand All @@ -23,7 +23,7 @@ const HighlightsModal = ({
onSubmit,
}) => {
const intl = useIntl();
const { highlights = [], displayName } = useSelector(getCurrentItem);
const { highlights = [], displayName } = useSelector(getCurrentSection);
const initialFormValues = getHighlightsFormValues(highlights);

const {
Expand Down
1 change: 1 addition & 0 deletions src/course-outline/hooks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const useCourseOutline = ({ courseId }) => {

const handleOpenHighlightsModal = (section) => {
dispatch(setCurrentItem(section));
dispatch(setCurrentSection(section));

Check failure on line 96 in src/course-outline/hooks.jsx

View workflow job for this annotation

GitHub Actions / tests

'setCurrentSection' is not defined
openHighlightsModal();
};

Expand Down

0 comments on commit 0ae0442

Please sign in to comment.