Compare commits

...

1 Commits

Author SHA1 Message Date
Mehak Nasir
60f6871227 Revert "fix: conditionally skipped some API calls and deffered script loading to improve performance"
This reverts commit 0f2ad8b7b4.
2023-02-23 14:36:45 +05:00
3 changed files with 6 additions and 6 deletions

View File

@@ -45,7 +45,7 @@
}; };
</script> </script>
<script <script
defer async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
id="MathJax-script" id="MathJax-script"
></script> ></script>
@@ -54,7 +54,7 @@
<div id="root" class="small"></div> <div id="root" class="small"></div>
<!-- begin usabilla live embed code --> <!-- begin usabilla live embed code -->
<script defer type="text/javascript"> <script type="text/javascript">
window.lightningjs || window.lightningjs ||
(function (n) { (function (n) {
var e = "lightningjs"; var e = "lightningjs";

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.
@@ -124,7 +124,7 @@ export default function DiscussionsHome() {
</Switch> </Switch>
)} )}
</div> </div>
{!enableInContextSidebar && <DiscussionsProductTour />} <DiscussionsProductTour />
</main> </main>
{!enableInContextSidebar && <Footer />} {!enableInContextSidebar && <Footer />}
</DiscussionContext.Provider> </DiscussionContext.Provider>