Commit 37b4ea7f authored by timel's avatar timel

fix: valtio

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