fix(AU-2174): Fix left sidebar throwing 404 #1556
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://2u-internal.atlassian.net/browse/AU-2174
#1437
Issue:
useCourseOutlineSidebar hook needs to use the
NewSidebarContext
ifisNewDiscussionSidebarViewEnabled
istrue
. At the time we set the SidebarProvider in the Course file we use the old side bar (SidebarProvider) or the new one (NewSidebarProvider) depending on theisNewDiscussionSidebarViewEnabled
value. We are not taking that into account when callinguseContext
in the mentioned hook, so all values returned from it areundefined
since we try to get values from a provider that was not set previously.New Discussion Sidebar enabled and New Left Sidebar enabled
Result: Error
New Discussion Sidebar enabled and New Left Sidebar disabled
Result: No error
New Discussion Sidebar disabled and New Left Sidebar enabled
Result: No error
New Discussion Sidebar disabled and New Left Sidebar disabled
Result: No error
Fix:
Depending on
isNewDiscussionSidebarViewEnabled
useSidebarContext
orNewSidebarContext
inside ofuseCourseOutlineSidebar
hook.https://www.loom.com/share/901c05d5dc024d9da4d07da020701213?sid=cce15834-2aeb-4ed6-8225-dedbf24e4137