@@ -2,7 +2,6 @@ import 'katex/dist/katex.min.css';
22
33import { Button , Classes , NonIdealState , Spinner } from '@blueprintjs/core' ;
44import classNames from 'classnames' ;
5- import path from 'path' ;
65import React , { useRef , useState } from 'react' ;
76import { useDispatch } from 'react-redux' ;
87import { useLocation , useNavigate , useParams } from 'react-router' ;
@@ -40,7 +39,7 @@ export const CodeSnippetContext = React.createContext({
4039
4140const loadingComponent = < NonIdealState title = "Loading Content" icon = { < Spinner /> } /> ;
4241
43- const AVAILABLE_SICP_TB_LANGS = [ 'en' , 'zh_CN' ] as const ;
42+ const AVAILABLE_SICP_TB_LANGS : readonly string [ ] = [ 'en' , 'zh_CN' ] ;
4443
4544const loadInitialLang = ( ) => {
4645 const saved = readSicpLangLocalStorage ( ) ;
@@ -107,7 +106,7 @@ const Sicp: React.FC = () => {
107106 // Handle loading of latest viewed section and fetch json data
108107 React . useEffect ( ( ) => {
109108 if ( paramLang || ( section && AVAILABLE_SICP_TB_LANGS . includes ( section ) ) ) {
110- const pLang = paramLang ? paramLang : section ;
109+ const pLang = ( paramLang ? paramLang : section ) ! ;
111110 if ( AVAILABLE_SICP_TB_LANGS . includes ( pLang ) ) {
112111 setLang ( pLang ) ;
113112 setSicpLangLocalStorage ( pLang ) ;
0 commit comments