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 ({
if (card) {
matStore.selectUnselectInfo.selectedList.push(info.location);
card.selectInfo.selected = true;
card.selectInfo.response = info.response;
}
}
......
......@@ -243,9 +243,10 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
const onClick = () => {
const onCardClick = (card: CardType) => {
if (card.selectInfo.selectable) {
if (card.selectInfo.response !== undefined) {
sendSelectMultiResponse([card.selectInfo.response]);
const selectInfo = card.selectInfo;
if (selectInfo.selectable || selectInfo.selected) {
if (selectInfo.response !== undefined) {
sendSelectMultiResponse([selectInfo.response]);
clearSelectInfo();
} else {
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