Skip to content

Commit e7f1600

Browse files
committed
fix: Fixed the issue of content not rendering directly into the website
1 parent 55d8fbb commit e7f1600

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/App.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, Suspense } from "react";
1+
import React, { useState, Suspense, useEffect } from "react";
22
import { Button, Table, Empty, Tabs, Image } from "antd";
33

44
import "highlight.js/styles/github.css";
@@ -109,8 +109,8 @@ function App() {
109109
// setHasSolution(!!problems[problemId]);
110110
// }, 1000);
111111

112-
// 开发环境不需要依赖 chrome 插件 query 函数
113-
const [langReady, setLangReady] = useState(isDev);
112+
// 开发环境和直接进入网站的方式不需要依赖 chrome 插件 query 函数
113+
const [langReady, setLangReady] = useState(isDev||!isInExtension());
114114
const [problemId, setProblemId] = useState("");
115115

116116
const [hasSolution, setHasSolution] = useState(false);
@@ -243,7 +243,7 @@ function App() {
243243
<Button
244244
type="link"
245245
target="_blank"
246-
href="https://leetcode-pp.github.io/leetcode-cheat/?tab=data-structure-vis"
246+
href={`https://leetcode-pp.github.io/leetcode-cheat/?tab=data-structure-vis&lang=${lang}`}
247247
>
248248
{t("Locale.app.goToTheWebsiteToUse")}
249249
</Button>

0 commit comments

Comments
 (0)