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 723a176
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/course-outline/page-alerts/PageAlerts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check failure on line 46 in src/course-outline/page-alerts/PageAlerts.jsx

View workflow job for this annotation

GitHub Actions / tests

This line has a length of 123. Maximum allowed is 120
const { newFiles, conflictingFiles, errorFiles } = useSelector(getPasteFileNotices);

const getAssetsUrl = () => {
Expand Down Expand Up @@ -77,12 +78,10 @@ const PageAlerts = ({

const discussionNotification = () => {
const { providerType } = discussionsSettings || {};

Check failure on line 80 in src/course-outline/page-alerts/PageAlerts.jsx

View workflow job for this annotation

GitHub Actions / tests

'providerType' is assigned a value but never used
if (providerType !== 'openedx') {
return null;
}

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

return (
Expand Down

0 comments on commit 723a176

Please sign in to comment.