Skip to content

Commit 7356b7b

Browse files
committed
Resolve 'yarn build' Errors
1 parent 62bc3dc commit 7356b7b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/pages/sicp/Sicp.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'katex/dist/katex.min.css';
22

33
import { Button, Classes, NonIdealState, Spinner } from '@blueprintjs/core';
44
import classNames from 'classnames';
5-
import path from 'path';
65
import React, { useRef, useState } from 'react';
76
import { useDispatch } from 'react-redux';
87
import { useLocation, useNavigate, useParams } from 'react-router';
@@ -40,7 +39,7 @@ export const CodeSnippetContext = React.createContext({
4039

4140
const 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

4544
const 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

Comments
 (0)