Compare commits
1 Commits
master
...
atajamul-i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f8b432aa8 |
@@ -71,14 +71,14 @@ export const useSidebarVisible = () => {
|
|||||||
return !hideSidebar;
|
return !hideSidebar;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function useCourseDiscussionData(courseId, enableInContextSidebar) {
|
export function useCourseDiscussionData(courseId) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { authenticatedUser } = useContext(AppContext);
|
const { authenticatedUser } = useContext(AppContext);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchBaseData() {
|
async function fetchBaseData() {
|
||||||
await dispatch(fetchCourseConfig(courseId));
|
await dispatch(fetchCourseConfig(courseId));
|
||||||
if (!enableInContextSidebar) { await dispatch(fetchCourseBlocks(courseId, authenticatedUser.username)); }
|
await dispatch(fetchCourseBlocks(courseId, authenticatedUser.username));
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchBaseData();
|
fetchBaseData();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default function DiscussionsHome() {
|
|||||||
courseId, postId, topicId, category, learnerUsername,
|
courseId, postId, topicId, category, learnerUsername,
|
||||||
} = params;
|
} = params;
|
||||||
|
|
||||||
useCourseDiscussionData(courseId, enableInContextSidebar);
|
useCourseDiscussionData(courseId);
|
||||||
useRedirectToThread(courseId, enableInContextSidebar);
|
useRedirectToThread(courseId, enableInContextSidebar);
|
||||||
|
|
||||||
/* Display the content area if we are currently viewing/editing a post or creating one.
|
/* Display the content area if we are currently viewing/editing a post or creating one.
|
||||||
|
|||||||
Reference in New Issue
Block a user