Commit 2ef8fbcc authored by timel's avatar timel

fix: some types error

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