Commit 9115bf9e authored by Chunchi Che's avatar Chunchi Che

fix

parent 68184e77
Pipeline #21067 passed with stages
in 18 minutes and 22 seconds
......@@ -95,25 +95,23 @@ export const checkCardModalCase = (
const newID =
code != 0 ? code : findCardByLocation(state, location)?.occupant?.id || 0;
if (newID) {
const newOption = {
meta: { id: code, data: {}, text: {} },
location: location.toObject(),
effectDescCode,
response,
};
for (const tag of state.modalState.checkCardModal.tags) {
if (tag.tagName === combinedTagName) {
tag.options.push(newOption);
return;
}
const newOption = {
meta: { id: newID, data: {}, text: {} },
location: location.toObject(),
effectDescCode,
response,
};
for (const tag of state.modalState.checkCardModal.tags) {
if (tag.tagName === combinedTagName) {
tag.options.push(newOption);
return;
}
state.modalState.checkCardModal.tags.push({
tagName: combinedTagName,
options: [newOption],
});
}
state.modalState.checkCardModal.tags.push({
tagName: combinedTagName,
options: [newOption],
});
});
builder.addCase(fetchCheckCardMeta.fulfilled, (state, action) => {
const tagName = action.payload.tagName;
......@@ -131,7 +129,9 @@ export const checkCardModalCase = (
option.meta.id == old.meta.id &&
cmpCardLocation(option.location, old.location)
) {
const cardID = old.meta.id;
old.meta = option.meta;
old.meta.id = cardID;
const effectDescCode = old.effectDescCode;
const effectDesc = effectDescCode
......
......@@ -117,7 +117,11 @@ const CheckCardModal = () => {
cover={
<img
alt={option.meta.id.toString()}
src={`${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`}
src={
option.meta.id
? `${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
: `${NeosConfig.assetsPath}/card_back.jpg`
}
style={{ width: 100 }}
/>
}
......
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