Commit a7df0c1c authored by timel's avatar timel

fix: hidden bugs founded by fmt

parent 0df22e5a
Pipeline #22848 passed with stages
in 13 minutes and 3 seconds
...@@ -186,10 +186,10 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -186,10 +186,10 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
key: nonEffectItem.length, key: nonEffectItem.length,
label: interactTypeToString(InteractType.ACTIVATE), label: interactTypeToString(InteractType.ACTIVATE),
onClick: async () => { onClick: async () => {
let card: CardType; let tmpCard: CardType;
if (!isField) { if (!isField) {
// 单卡: 直接发动这个卡的效果 // 单卡: 直接发动这个卡的效果
card = cards[0]; tmpCard = cards[0];
} else { } else {
// 场地: 选择卡片 // 场地: 选择卡片
// TODO: hint // TODO: hint
...@@ -208,11 +208,11 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -208,11 +208,11 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
card, card,
})), })),
}); });
card = option[0].card! as any; // 一定会有的,有输入则定有输出 tmpCard = option[0].card! as any; // 一定会有的,有输入则定有输出
} }
// 选择发动哪个效果 // 选择发动哪个效果
handleEffectActivation( handleEffectActivation(
card.idleInteractivities tmpCard.idleInteractivities
.filter( .filter(
({ interactType }) => interactType === InteractType.ACTIVATE ({ interactType }) => interactType === InteractType.ACTIVATE
) )
...@@ -221,7 +221,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -221,7 +221,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
response: x.response, response: x.response,
effectCode: x.activateIndex, effectCode: x.activateIndex,
})), })),
card.meta tmpCard.meta
); );
}, },
}; };
......
...@@ -12,12 +12,12 @@ const NeosConfig = useConfig(); ...@@ -12,12 +12,12 @@ const NeosConfig = useConfig();
const DefaultUserName = "Guest"; const DefaultUserName = "Guest";
const Home: React.FC = () => { const Home: React.FC = () => {
const user = useSnapshot(accountStore).user; const { user } = useSnapshot(accountStore);
const navigate = useNavigate(); const navigate = useNavigate();
const onLogout = () => {}; // TODO const onLogout = () => {}; // TODO
const onMatchAI = () => { const onMatchAI = () => {
const username = user?.username ?? DefaultUserName; const username = accountStore.user?.username ?? DefaultUserName;
navigate( navigate(
`/room/${username}/${encodeURIComponent("AI")}/${ `/room/${username}/${encodeURIComponent("AI")}/${
NeosConfig.servers[0].ip NeosConfig.servers[0].ip
......
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