File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,23 @@ import { getLesson, getLessons } from "../../../data/lesson";
44import getCourseConfig from "../../../data/course" ;
55import Corner from "../../../components/corner" ;
66import { Context } from "../../../context/headerContext" ;
7+ import createCopyCodeFunctionality from "../../../data/copyCode" ;
78
89export default function LessonSlug ( { post } ) {
910 const courseInfo = getCourseConfig ( ) ;
1011 const [ _ , setHeader ] = useContext ( Context ) ;
12+
1113 useEffect ( ( ) => {
1214 setHeader ( {
1315 section : post . section ,
1416 title : post . title ,
1517 icon : post . icon ,
1618 } ) ;
17- return ( ) => setHeader ( { } ) ;
19+ let elementsToClean = createCopyCodeFunctionality ( ) ;
20+ return ( ) => {
21+ setHeader ( { } ) ;
22+ elementsToClean = [ ] ;
23+ }
1824 } , [ ] ) ;
1925
2026 const title = post . title
You can’t perform that action at this time.
0 commit comments