From 723a17664d64fd1a0ea6d80fe99c7c0d0c74a15d Mon Sep 17 00:00:00 2001 From: cef Date: Fri, 23 Aug 2024 16:25:57 -0500 Subject: [PATCH] feat: save discussion alert dismissal --- src/course-outline/page-alerts/PageAlerts.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/course-outline/page-alerts/PageAlerts.jsx b/src/course-outline/page-alerts/PageAlerts.jsx index 4b0eb0dc78..cbaf701ed3 100644 --- a/src/course-outline/page-alerts/PageAlerts.jsx +++ b/src/course-outline/page-alerts/PageAlerts.jsx @@ -41,8 +41,9 @@ 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 = () => { @@ -77,12 +78,10 @@ const PageAlerts = ({ const discussionNotification = () => { const { providerType } = discussionsSettings || {}; - if (providerType !== 'openedx') { - return null; - } const onDismiss = () => { setShowDiscussionAlert(false); + localStorage.setItem(discussionAlertDismissKey, 'true'); }; return (