@@ -10,10 +10,10 @@ import { ContactUsSlideoverProvider } from '../../context/ContactUsSlideoverCont
10
10
import MarkdownLayoutContext from '../../context/MarkdownLayoutContext' ;
11
11
import { ProblemSolutionContext } from '../../context/ProblemSolutionContext' ;
12
12
import { ProblemSuggestionModalProvider } from '../../context/ProblemSuggestionModalContext' ;
13
- import { useUserLangSetting } from '../../context/UserDataContext/properties/simpleProperties' ;
13
+ import { getUserLangSetting } from '../../context/UserDataContext/properties/simpleProperties' ;
14
14
import {
15
+ getUserProgressOnModules ,
15
16
useSetProgressOnModule ,
16
- useUserProgressOnModules ,
17
17
} from '../../context/UserDataContext/properties/userProgress' ;
18
18
import { ModuleInfo } from '../../models/module' ;
19
19
import { SolutionInfo } from '../../models/solution' ;
@@ -69,9 +69,9 @@ export default function MarkdownLayout({
69
69
markdownData : ModuleInfo | SolutionInfo ;
70
70
children : React . ReactNode ;
71
71
} ) {
72
- const userProgressOnModules = useUserProgressOnModules ( ) ;
72
+ const userProgressOnModules = getUserProgressOnModules ( ) ;
73
73
const setModuleProgress = useSetProgressOnModule ( ) ;
74
- const lang = useUserLangSetting ( ) ;
74
+ const lang = getUserLangSetting ( ) ;
75
75
76
76
const [ isMobileNavOpen , setIsMobileNavOpen ] = useState ( false ) ;
77
77
const moduleProgress =
@@ -119,12 +119,11 @@ export default function MarkdownLayout({
119
119
// document.querySelector('html').style.scrollBehavior = 'smooth';
120
120
// return () => (document.querySelector('html').style.scrollBehavior = 'auto');
121
121
// }, []);
122
-
122
+ const problemSolutionContext = React . useContext ( ProblemSolutionContext ) ;
123
123
let activeIDs = [ ] ;
124
124
if ( markdownData instanceof ModuleInfo ) {
125
125
activeIDs . push ( markdownData . id ) ;
126
126
} else {
127
- const problemSolutionContext = React . useContext ( ProblemSolutionContext ) ;
128
127
activeIDs = problemSolutionContext . modulesThatHaveProblem . map ( x => x . id ) ;
129
128
}
130
129
0 commit comments