Commit 3b0de3ec authored by Chunchi Che's avatar Chunchi Che

fix strings

parent 06cbef40
Pipeline #20715 passed with stages
in 12 minutes and 42 seconds
......@@ -20,7 +20,6 @@ import Phase from "./phase";
import CheckCardModalV2 from "./checkCardModalV2";
import ExtraDeck from "./extraDeck";
import NeosLayout from "./layout";
import { initStrings } from "../../api/strings";
import NeosConfig from "../../../neos.config.json";
import DuelTimeLine from "./timeLine";
import { Row } from "antd";
......@@ -34,21 +33,6 @@ import {
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const NeosDuel = () => {
// 应该用更优雅的方式处理`useEffect`执行两次的问题
const initialRender = useRef(true);
useEffect(() => {
const init = async () => {
await initStrings();
};
if (initialRender.current) {
initialRender.current = false;
return;
}
init();
}, []);
const meInfo = useAppSelector(selectMeInitInfo);
const opInfo = useAppSelector(selectOpInitInfo);
......
......@@ -46,6 +46,7 @@ import NeosConfig from "../../neos.config.json";
import YGOProDeck from "ygopro-deck-encode";
//@ts-ignore
import rustInit from "rust-src";
import { initStrings } from "../api/strings";
const READY_STATE = "ready";
......@@ -78,9 +79,11 @@ const WaitRoom = () => {
initInfo: { dbUrl: NeosConfig.cardsDbUrl },
});
// 初始化文案
await initStrings();
// 初始化wasm
const wasm = await rustInit();
console.log(wasm);
await rustInit();
};
init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment