Commit 5af04b89 authored by Chunchi Che's avatar Chunchi Che

fix fetchCheckCardMeta and spring focus

parent f7897383
......@@ -25,11 +25,19 @@ const helper = async (
selected?: boolean,
mustSelect?: boolean,
) => {
const controller = location.controller;
const { controller, zone, sequence } = location;
const target = cardStore.at(zone, controller, sequence);
// 这里可能直接用target.meta即可,不用再查一遍DB
// 但是ygopro后端传回来了code,感觉这里会有些坑,因此求稳这样写
const newID =
code !== 0
? code
: cardStore.at(location.zone, controller, location.sequence)?.code || 0;
: target !== undefined
? target.code !== 0
? target.code
: target.meta.id
: 0;
const meta = fetchCard(newID);
const effectDesc = effect_description
......
......@@ -9,7 +9,8 @@ export const focus = async (props: { card: CardType; api: SpringApi }) => {
const { card, api } = props;
if (
card.location.zone === ygopro.CardZone.HAND ||
card.location.zone === ygopro.CardZone.DECK
card.location.zone === ygopro.CardZone.DECK ||
card.location.zone === ygopro.CardZone.EXTRA
) {
const current = { ...api.current[0].get() };
await asyncStart(api)({
......
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