Commit 02505ee4 authored by Chunchi Che's avatar Chunchi Che

fix

parent 38e4fcfc
Pipeline #21053 passed with stages
in 18 minutes and 57 seconds
import { ygopro } from "../../api/ocgcore/idl/ocgcore"; import { ygopro } from "../../api/ocgcore/idl/ocgcore";
import { setSortCardModalIsOpen } from "../../reducers/duel/mod";
import { fetchSortCardMeta } from "../../reducers/duel/modal/sortCardModalSlice"; import { fetchSortCardMeta } from "../../reducers/duel/modal/sortCardModalSlice";
import { AppDispatch } from "../../store"; import { AppDispatch } from "../../store";
import MsgSortCard = ygopro.StocGameMessage.MsgSortCard; import MsgSortCard = ygopro.StocGameMessage.MsgSortCard;
...@@ -7,4 +8,5 @@ export default (sortCard: MsgSortCard, dispatch: AppDispatch) => { ...@@ -7,4 +8,5 @@ export default (sortCard: MsgSortCard, dispatch: AppDispatch) => {
for (const option of sortCard.options) { for (const option of sortCard.options) {
dispatch(fetchSortCardMeta(option.toObject())); dispatch(fetchSortCardMeta(option.toObject()));
} }
dispatch(setSortCardModalIsOpen(true));
}; };
import React, { useRef, useState } from "react"; import React, { useEffect, useRef, useState } from "react";
import { import {
DndContext, DndContext,
closestCenter, closestCenter,
...@@ -57,7 +57,10 @@ const SortCardModal = () => { ...@@ -57,7 +57,10 @@ const SortCardModal = () => {
} }
}; };
console.log(items); useEffect(() => {
setItems(options);
}, [options]);
return ( return (
<DragModal <DragModal
modalProps={{ modalProps={{
......
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