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