Commit f41155d8 authored by Chunchi Che's avatar Chunchi Che

rename

parent 71871e17
import { messageStore } from "../store";
const { selectCardActions } = messageStore;
export const clearSelectActions = () => {
selectCardActions.isOpen = false;
selectCardActions.isChain = undefined;
selectCardActions.min = undefined;
selectCardActions.max = undefined;
selectCardActions.cancelAble = false;
selectCardActions.totalLevels = undefined;
selectCardActions.selecteds = [];
selectCardActions.selectables = [];
selectCardActions.mustSelects = [];
selectCardActions.finishAble = false;
selectCardActions.overflow = false;
};
export * from "./clearAllIdleInteractivities";
export * from "./clearAllPlaceInteradtivities";
export * from "./clearSelectActions";
......@@ -4,11 +4,11 @@ import {
Alert,
CardListModal,
CardModal,
CheckCardModal,
CheckCounterModal,
HintNotification,
OptionModal,
PositionModal,
SelectActionsModal,
SortCardModal,
YesNoModal,
} from "./Message";
......@@ -22,7 +22,7 @@ const NeosDuel = () => {
<CardModal />
<CardListModal />
<HintNotification />
<CheckCardModal />
<SelectActionsModal />
<YesNoModal />
<PositionModal />
<OptionModal />
......
......@@ -10,7 +10,7 @@ import {
sendSelectSingleResponse,
} from "@/api";
import { useConfig } from "@/config";
import { matStore, messageStore } from "@/stores";
import { clearSelectActions, matStore, messageStore } from "@/stores";
import { DragModal } from "./DragModal";
......@@ -20,7 +20,7 @@ const FINISH_RESPONSE = -1;
const { selectCardActions } = messageStore;
export const CheckCardModal = () => {
export const SelectActionsModal = () => {
const snap = useSnapshot(selectCardActions);
const isOpen = snap.isOpen;
const isChain = snap.isChain;
......@@ -55,19 +55,6 @@ export const CheckCardModal = () => {
? response.length == 1
: response.length >= min && response.length <= max && levelMatched;
const resetCheckCardModal = () => {
selectCardActions.isOpen = false;
selectCardActions.isChain = undefined;
selectCardActions.min = undefined;
selectCardActions.max = undefined;
selectCardActions.cancelAble = false;
selectCardActions.totalLevels = undefined;
selectCardActions.selecteds = [];
selectCardActions.selectables = [];
selectCardActions.finishAble = false;
selectCardActions.overflow = false;
};
return (
<DragModal
title={`${preHintMsg} ${selectHintMsg} ${min}-${max} ${
......@@ -89,7 +76,7 @@ export const CheckCardModal = () => {
} else {
sendSelectMultiResponse(values);
}
resetCheckCardModal();
clearSelectActions();
}}
onFocus={() => {}}
onBlur={() => {}}
......@@ -100,7 +87,7 @@ export const CheckCardModal = () => {
disabled={!finishable}
onClick={() => {
sendSelectSingleResponse(FINISH_RESPONSE);
resetCheckCardModal();
clearSelectActions();
}}
onFocus={() => {}}
onBlur={() => {}}
......@@ -112,7 +99,7 @@ export const CheckCardModal = () => {
disabled={!cancelable}
onClick={() => {
sendSelectSingleResponse(CANCEL_RESPONSE);
resetCheckCardModal();
clearSelectActions();
}}
onFocus={() => {}}
onBlur={() => {}}
......
export * from "./Alert";
export * from "./CardListModal";
export * from "./CardModal";
export * from "./CheckCardModal";
export * from "./CheckCounterModal";
export * from "./DragModal";
export * from "./HintNotification";
export * from "./OptionModal";
export * from "./PositionModal";
export * from "./SelectActionsModal";
export * from "./SendBox";
export * from "./SortCardModal";
export * from "./Status";
......
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