Commit b6f722a4 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'optimize/loading' into 'main'

add loading for Start

See merge request !392
parents 9c95d331 3fffebe1
Pipeline #28437 passed with stages
in 9 minutes and 33 seconds
......@@ -4,12 +4,13 @@ import { initStrings, initSuperPrerelease } from "@/api";
import { useConfig } from "@/config";
import { getUIContainer, initUIContainer } from "@/container/compat";
import { initReplaySocket, initSocket } from "@/middleware/socket";
import sqliteMiddleWare, { sqliteCmd } from "@/middleware/sqlite";
import {
pollSocketLooper,
pollSocketLooperWithAgent,
} from "@/service/executor";
import { initSqlite } from "../Layout/utils";
const NeosConfig = useConfig();
// 连接SRVPRO服务
......@@ -29,13 +30,7 @@ export const connectSrvpro = async (params: {
await rustInit(url);
// 初始化sqlite
await sqliteMiddleWare({
cmd: sqliteCmd.INIT,
initInfo: {
releaseDbUrl: NeosConfig.releaseDbUrl,
preReleaseDbUrl: NeosConfig.preReleaseDbUrl,
},
});
await initSqlite();
// 初始化I18N文案
await initStrings();
......
......@@ -6,8 +6,8 @@ import { useSnapshot } from "valtio";
import { getSSOSignInUrl } from "@/api";
import { useConfig } from "@/config";
import { AudioActionType, changeScene } from "@/infra/audio";
import { accountStore } from "@/stores";
import { Background, SpecialButton } from "@/ui/Shared";
import { accountStore, initStore } from "@/stores";
import { Background, Loading, SpecialButton } from "@/ui/Shared";
import styles from "./index.module.scss";
......@@ -22,10 +22,12 @@ export const loader: LoaderFunction = async () => {
export const Component: React.FC = () => {
const { t } = useTranslation("Start");
const { user } = useSnapshot(accountStore);
const { progress } = useSnapshot(initStore.sqlite);
return (
<>
<Background />
<div className={styles.wrap}>
{progress === 1 ? (
<main className={styles.main}>
<div className={styles.left}>
<img
......@@ -49,6 +51,9 @@ export const Component: React.FC = () => {
/>
</div>
</main>
) : (
<Loading progress={progress * 100} />
)}
</div>
</>
);
......
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