Commit bce465aa authored by timel's avatar timel

fix: minimal probability of card deck not found

parent c521af67
Pipeline #21159 passed with stages
in 10 minutes and 38 seconds
......@@ -8,7 +8,8 @@ const DECKS: Record<string, { default: IDeck }> = import.meta.glob(
export const DeckManager = _objToMap(
Object.keys(DECKS).map((key) => ({
...DECKS[key].default,
deckName: key.split("/").pop()?.split(".")[0] ?? "undefined",
deckName:
key.split("/").pop()?.split(".").slice(0, -1).join(".") ?? "undefined",
}))
);
......
......@@ -11,14 +11,14 @@ interface DefaultsConfig {
const defaultConfig: DefaultsConfig = {
defaultPlayer: "",
// 无需考虑undefined的情况,如果为undefined,界面上会显示【请选择】
defaultDeck: VITE_AI_MODE_DEFAULT_DECK,
defaultDeck: "",
defaultPassword: "",
defaultMora: "scissors",
};
const aiModeConfig: DefaultsConfig = {
...defaultConfig,
defaultDeck: VITE_AI_MODE_DEFAULT_DECK || "Hero",
defaultPlayer: `AiKiller${Math.random().toString(36).slice(2)}}`,
defaultPassword: "AI",
};
......
......@@ -275,7 +275,6 @@ const WaitRoom = () => {
<Space wrap size={16}>
<Select
placeholder="请选择卡组"
defaultValue={defaultDeck}
onChange={handleChoseDeck}
options={decks}
style={{ width: 160 }}
......
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