Commit f95cbca7 authored by Chunchi Che's avatar Chunchi Che

add backtrack function

parent 540efd5a
Pipeline #27002 passed with stages
in 10 minutes and 43 seconds
...@@ -34,6 +34,7 @@ export default async ({ ...@@ -34,6 +34,7 @@ export default async ({
if (card) { if (card) {
matStore.selectUnselectInfo.selectedList.push(info.location); matStore.selectUnselectInfo.selectedList.push(info.location);
card.selectInfo.selected = true; card.selectInfo.selected = true;
card.selectInfo.response = info.response;
} }
} }
......
...@@ -243,9 +243,10 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -243,9 +243,10 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
const onClick = () => { const onClick = () => {
const onCardClick = (card: CardType) => { const onCardClick = (card: CardType) => {
if (card.selectInfo.selectable) { const selectInfo = card.selectInfo;
if (card.selectInfo.response !== undefined) { if (selectInfo.selectable || selectInfo.selected) {
sendSelectMultiResponse([card.selectInfo.response]); if (selectInfo.response !== undefined) {
sendSelectMultiResponse([selectInfo.response]);
clearSelectInfo(); clearSelectInfo();
} else { } else {
console.error("card is selectable but the response is undefined!"); console.error("card is selectable but the response is undefined!");
......
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