Commit 37b4ea7f authored by timel's avatar timel

fix: valtio

parent 52a18270
...@@ -36,7 +36,6 @@ const localStore = proxy(defaultProps); ...@@ -36,7 +36,6 @@ const localStore = proxy(defaultProps);
export const SelectActionsModal: React.FC = () => { export const SelectActionsModal: React.FC = () => {
const { const {
isOpen, isOpen,
isChain,
min, min,
max, max,
single, single,
...@@ -51,7 +50,7 @@ export const SelectActionsModal: React.FC = () => { ...@@ -51,7 +50,7 @@ export const SelectActionsModal: React.FC = () => {
const onSubmit = (options: Snapshot<Option[]>) => { const onSubmit = (options: Snapshot<Option[]>) => {
const values = options.map((option) => option.response!); const values = options.map((option) => option.response!);
if (isChain) { if (localStore.isChain) {
sendSelectSingleResponse(values[0]); sendSelectSingleResponse(values[0]);
} else { } else {
sendSelectMultiResponse(values); sendSelectMultiResponse(values);
......
...@@ -7,9 +7,9 @@ import { sendSelectPlaceResponse, ygopro } from "@/api"; ...@@ -7,9 +7,9 @@ import { sendSelectPlaceResponse, ygopro } from "@/api";
import { import {
type BlockState, type BlockState,
cardStore, cardStore,
isMe,
type PlaceInteractivity, type PlaceInteractivity,
placeStore, placeStore,
isMe,
} from "@/stores"; } from "@/stores";
const BgBlock: React.FC< const BgBlock: React.FC<
...@@ -78,10 +78,10 @@ const BgRow: React.FC<{ ...@@ -78,10 +78,10 @@ const BgRow: React.FC<{
); );
const BgOtherBlocks: React.FC<{ me?: boolean }> = ({ me }) => { const BgOtherBlocks: React.FC<{ me?: boolean }> = ({ me }) => {
const snapCards = useSnapshot(cardStore); useSnapshot(cardStore);
const meController = isMe(0) ? 0 : 1; const meController = isMe(0) ? 0 : 1;
const judgeGlowing = (zone: ygopro.CardZone) => const judgeGlowing = (zone: ygopro.CardZone) =>
!!snapCards !!cardStore
.at(zone, meController) .at(zone, meController)
.reduce((sum, c) => (sum += c.idleInteractivities.length), 0); .reduce((sum, c) => (sum += c.idleInteractivities.length), 0);
const glowingExtra = judgeGlowing(ygopro.CardZone.EXTRA); const glowingExtra = judgeGlowing(ygopro.CardZone.EXTRA);
......
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