Commit 7c00601a authored by Chunchi Che's avatar Chunchi Che

update fetchStrings

parent 2bd3b936
Pipeline #20595 passed with stages
in 5 minutes and 43 seconds
......@@ -15,14 +15,7 @@ export async function initStrings() {
export async function fetchStrings(
region: string,
id: number,
local?: boolean
id: number
): Promise<string> {
if (local) {
return localStorage.getItem(`${region}_${id}`) || "";
}
return (
await axios.get<string>(`http://localhost:3030/strings/${region}_${id}`)
).data;
}
......@@ -16,7 +16,7 @@ export const fetchCommonHintMeta = createAsyncThunk(
const player = param[0];
const hintData = param[1];
const hintMeta = await fetchStrings("!system", hintData, true);
const hintMeta = await fetchStrings("!system", hintData);
const response: [number, string] = [player, hintMeta];
return response;
......
......@@ -31,7 +31,7 @@ export const fetchYesNoMeta = createAsyncThunk(
cardLocation: ygopro.CardLocation
) => string;
}) => {
const desc = await fetchStrings("!system", param.descCode, true);
const desc = await fetchStrings("!system", param.descCode);
const meta = await fetchCard(param.code, true);
// TODO: 国际化文案
......
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