Commit 2ef8fbcc authored by timel's avatar timel

fix: some types error

parent d2b01b1b
...@@ -6,7 +6,7 @@ import { ygopro } from "@/api"; ...@@ -6,7 +6,7 @@ import { ygopro } from "@/api";
import { sendSelectPlaceResponse } from "@/api/ocgcore/ocgHelper"; import { sendSelectPlaceResponse } from "@/api/ocgcore/ocgHelper";
import { useConfig } from "@/config"; import { useConfig } from "@/config";
import { useClick } from "@/hook"; import { useClick } from "@/hook";
import { CardState } from "@/reducers/duel/generic"; // import { CardState } from "@/reducers/duel/generic";
import { import {
setCardListModalInfo, setCardListModalInfo,
setCardListModalIsOpen, setCardListModalIsOpen,
...@@ -20,7 +20,7 @@ import { store } from "@/store"; ...@@ -20,7 +20,7 @@ import { store } from "@/store";
import { interactTypeToString } from "../utils"; import { interactTypeToString } from "../utils";
import { useSnapshot } from "valtio"; import { useSnapshot } from "valtio";
import { clearAllIdleInteractivities } from "@/valtioStores"; import { clearAllIdleInteractivities, type CardState } from "@/valtioStores";
const NeosConfig = useConfig(); const NeosConfig = useConfig();
...@@ -62,8 +62,8 @@ export const FixedSlot = (props: { ...@@ -62,8 +62,8 @@ export const FixedSlot = (props: {
useClick( useClick(
(_event) => { (_event) => {
if (snapState.placeInteractivities) { if (snapState.placeInteractivity) {
sendSelectPlaceResponse(snapState.placeInteractivities.response); sendSelectPlaceResponse(snapState.placeInteractivity.response);
// dispatch(props.clearPlaceInteractivitiesAction(0)); // dispatch(props.clearPlaceInteractivitiesAction(0));
// dispatch(props.clearPlaceInteractivitiesAction(1)); // dispatch(props.clearPlaceInteractivitiesAction(1));
clearAllIdleInteractivities(0); clearAllIdleInteractivities(0);
...@@ -117,8 +117,7 @@ export const FixedSlot = (props: { ...@@ -117,8 +117,7 @@ export const FixedSlot = (props: {
rotation={rotation} rotation={rotation}
enableEdgesRendering enableEdgesRendering
edgesWidth={ edgesWidth={
snapState.placeInteractivities || snapState.placeInteractivity || snapState.idleInteractivities.length > 0
snapState.idleInteractivities.length > 0
? edgesWidth ? edgesWidth
: 0 : 0
} }
......
...@@ -85,7 +85,7 @@ const CHand = (props: { ...@@ -85,7 +85,7 @@ const CHand = (props: {
const state = props.state; const state = props.state;
const [hovered, setHovered] = useState(false); const [hovered, setHovered] = useState(false);
const position = props.position; const position = props.position;
const dispatch = store.dispatch; // const dispatch = store.dispatch;
const [spring, api] = useSpring( const [spring, api] = useSpring(
() => ({ () => ({
...@@ -120,26 +120,26 @@ const CHand = (props: { ...@@ -120,26 +120,26 @@ const CHand = (props: {
useClick( useClick(
() => { () => {
if (state.occupant) { if (state.occupant) {
dispatch(setCardModalMeta(state.occupant)); // dispatch(setCardModalMeta(state.occupant));
messageStore.cardModal.meta = state.occupant; messageStore.cardModal.meta = state.occupant;
} }
dispatch( // dispatch(
setCardModalInteractivies( // setCardModalInteractivies(
state.idleInteractivities.map((interactive) => { // state.idleInteractivities.map((interactive) => {
return { // return {
desc: interactTypeToString(interactive.interactType), // desc: interactTypeToString(interactive.interactType),
response: interactive.response, // response: interactive.response,
}; // };
}) // })
) // )
); // );
messageStore.cardModal.interactivies = state.idleInteractivities.map( messageStore.cardModal.interactivies = state.idleInteractivities.map(
(interactive) => ({ (interactive) => ({
desc: interactTypeToString(interactive.interactType), desc: interactTypeToString(interactive.interactType),
response: interactive.response, response: interactive.response,
}) })
); );
dispatch(setCardModalIsOpen(true)); // dispatch(setCardModalIsOpen(true));
messageStore.cardModal.isOpen = true; messageStore.cardModal.isOpen = true;
}, },
planeRef, planeRef,
......
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