Commit f20e1199 authored by Chunchi Che's avatar Chunchi Che

fix filter in BuildDeck

parent 6be2bb28
Pipeline #23666 passed with stages
in 12 minutes and 57 seconds
...@@ -70,6 +70,13 @@ export const loader: LoaderFunction = async () => { ...@@ -70,6 +70,13 @@ export const loader: LoaderFunction = async () => {
}); });
} }
// 最后,等待I18N文案的加载
if (!initStore.i18n) {
await new Promise<void>((rs) => {
subscribeKey(initStore, "i18n", (done) => done && rs());
});
}
return null; return null;
}; };
......
...@@ -24,6 +24,7 @@ import { ...@@ -24,6 +24,7 @@ import {
handleSSOLogin, handleSSOLogin,
initDeck, initDeck,
initForbidden, initForbidden,
initI18N,
initSqlite, initSqlite,
initWASM, initWASM,
} from "./utils"; } from "./utils";
...@@ -36,6 +37,7 @@ export const loader: LoaderFunction = async () => { ...@@ -36,6 +37,7 @@ export const loader: LoaderFunction = async () => {
initSqlite(); initSqlite();
initWASM(); initWASM();
initForbidden(); initForbidden();
initI18N();
return null; return null;
}; };
......
import rustInit from "rust-src"; import rustInit from "rust-src";
import { CookieKeys, forbidden, getCookie, setCookie } from "@/api"; import {
CookieKeys,
forbidden,
getCookie,
initStrings,
setCookie,
} from "@/api";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { useEnv } from "@/hook"; import { useEnv } from "@/hook";
import sqliteMiddleWare, { sqliteCmd } from "@/middleware/sqlite"; import sqliteMiddleWare, { sqliteCmd } from "@/middleware/sqlite";
...@@ -49,6 +55,14 @@ export const initForbidden = async () => { ...@@ -49,6 +55,14 @@ export const initForbidden = async () => {
} }
}; };
/** 加载I18N文案 */
export const initI18N = async () => {
if (!initStore.i18n) {
await initStrings();
initStore.i18n = true;
}
};
/** sso登录跳转回来 */ /** sso登录跳转回来 */
export const handleSSOLogin = async (search: string) => { export const handleSSOLogin = async (search: string) => {
/** 从SSO跳转回的URL之中,解析用户信息 */ /** 从SSO跳转回的URL之中,解析用户信息 */
......
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