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 = ( ...@@ -95,25 +95,23 @@ export const checkCardModalCase = (
const newID = const newID =
code != 0 ? code : findCardByLocation(state, location)?.occupant?.id || 0; code != 0 ? code : findCardByLocation(state, location)?.occupant?.id || 0;
if (newID) { const newOption = {
const newOption = { meta: { id: newID, data: {}, text: {} },
meta: { id: code, data: {}, text: {} }, location: location.toObject(),
location: location.toObject(), effectDescCode,
effectDescCode, response,
response, };
}; for (const tag of state.modalState.checkCardModal.tags) {
for (const tag of state.modalState.checkCardModal.tags) { if (tag.tagName === combinedTagName) {
if (tag.tagName === combinedTagName) { tag.options.push(newOption);
tag.options.push(newOption); return;
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) => { builder.addCase(fetchCheckCardMeta.fulfilled, (state, action) => {
const tagName = action.payload.tagName; const tagName = action.payload.tagName;
...@@ -131,7 +129,9 @@ export const checkCardModalCase = ( ...@@ -131,7 +129,9 @@ export const checkCardModalCase = (
option.meta.id == old.meta.id && option.meta.id == old.meta.id &&
cmpCardLocation(option.location, old.location) cmpCardLocation(option.location, old.location)
) { ) {
const cardID = old.meta.id;
old.meta = option.meta; old.meta = option.meta;
old.meta.id = cardID;
const effectDescCode = old.effectDescCode; const effectDescCode = old.effectDescCode;
const effectDesc = effectDescCode const effectDesc = effectDescCode
......
...@@ -117,7 +117,11 @@ const CheckCardModal = () => { ...@@ -117,7 +117,11 @@ const CheckCardModal = () => {
cover={ cover={
<img <img
alt={option.meta.id.toString()} 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 }} 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