Compare commits

...

1 Commits

Author SHA1 Message Date
adeel.tajamul
9f8b432aa8 fix: incontext crashing 2023-02-23 18:53:30 +05:00
2 changed files with 3 additions and 3 deletions

View File

@@ -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();

View File

@@ -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.