Skip to content

Commit

Permalink
feat: save discussion alert dismissal
Browse files Browse the repository at this point in the history
  • Loading branch information
CefBoud committed Aug 23, 2024
1 parent 9e49a74 commit 04bdc64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/course-outline/page-alerts/PageAlerts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ const PageAlerts = ({
const intl = useIntl();
const dispatch = useDispatch();
const studioBaseUrl = getConfig().STUDIO_BASE_URL;
const discussionAlertDismissKey = `discussionAlertDismissed-${courseId}`;
const [showConfigAlert, setShowConfigAlert] = useState(true);
const [showDiscussionAlert, setShowDiscussionAlert] = useState(true);
const [showDiscussionAlert, setShowDiscussionAlert] = useState(
localStorage.getItem(discussionAlertDismissKey) === null,
);
const { newFiles, conflictingFiles, errorFiles } = useSelector(getPasteFileNotices);

const getAssetsUrl = () => {
Expand Down Expand Up @@ -83,6 +86,7 @@ const PageAlerts = ({

const onDismiss = () => {
setShowDiscussionAlert(false);
localStorage.setItem(discussionAlertDismissKey, 'true');

Check warning on line 89 in src/course-outline/page-alerts/PageAlerts.jsx

View check run for this annotation

Codecov / codecov/patch

src/course-outline/page-alerts/PageAlerts.jsx#L89

Added line #L89 was not covered by tests
};

return (
Expand Down

0 comments on commit 04bdc64

Please sign in to comment.