Skip to content

Commit

Permalink
Merge pull request #488 from mahajanmahesh935/main
Browse files Browse the repository at this point in the history
TASK : #0000 Restrict user to access unenrolled course contents
  • Loading branch information
ManojNathIC authored Aug 13, 2024
2 parents c0e60d5 + 12b66fd commit 4f47833
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/nulp_elite/src/pages/content/joinCourse.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ const JoinCourse = () => {
}, 2000);
setToasterOpen(true);
};

const showOpenContenErrorMessage =(msg) =>{
setToasterMessage(msg);
setToasterOpen(true);
}
useEffect(() => {
const handleResize = () => setIsMobile(window.innerWidth <= 767);
window.addEventListener("resize", handleResize);
Expand Down Expand Up @@ -496,7 +501,8 @@ const JoinCourse = () => {
});
};

const handleLinkClick = (id) => {
const handleLinkClick = (id) => {
if (isEnroll) {
navigate(`${routeConfig.ROUTES.PLAYER_PAGE.PLAYER}?${id}`, {
state: {
coursename: userData?.result?.content?.name,
Expand All @@ -506,7 +512,10 @@ const JoinCourse = () => {
consumedcontents: ConsumedContents,
},
});
};
} else {
showOpenContenErrorMessage("You must join the course to get complete access to content.");
}
};

const handleSnackbarClose = (event, reason) => {
if (reason === "clickaway") {
Expand Down

0 comments on commit 4f47833

Please sign in to comment.