Commit 27586be0 authored by Chunchi Che's avatar Chunchi Che

optimize small

parent df3f1d64
Pipeline #22626 passed with stages
in 11 minutes and 11 seconds
......@@ -60,13 +60,21 @@ const WaitRoom = () => {
if (ip && player && player.length != 0 && passWd && passWd.length != 0) {
const init = async () => {
// 初始化wasm
// 需要在连接websocket之前
const url =
import.meta.env.BASE_URL === "/"
? undefined
: new URL("rust_src_bg.wasm", `${import.meta.env.BASE_URL}assets/`);
await rustInit(url);
// 初始化sqlite
await sqliteMiddleWare({
cmd: sqliteCmd.INIT,
initInfo: { dbUrl: NeosConfig.cardsDbUrl },
});
// 初始化文案
await initStrings();
// 页面第一次渲染时,通过socket中间件向ygopro服务端请求建立长连接
socketMiddleWare({
cmd: socketCmd.CONNECT,
......@@ -76,15 +84,6 @@ const WaitRoom = () => {
passWd,
},
});
// 初始化sqlite
await sqliteMiddleWare({
cmd: sqliteCmd.INIT,
initInfo: { dbUrl: NeosConfig.cardsDbUrl },
});
// 初始化文案
await initStrings();
};
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