@gamelearn/arcade-components 1.4.17 → 1.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -137,20 +137,22 @@ var Board = function Board(_ref) {
137
137
  handleCorrect(index);
138
138
  } else {
139
139
  if (cards[index].order !== currentOrder) {
140
+ var _cards$index;
141
+
140
142
  var tempWrong = Array.from(wrongOrder);
141
143
  tempWrong[index] = index;
142
144
  setWrongOrder(tempWrong);
143
- handleError();
145
+ handleError(((_cards$index = cards[index]) === null || _cards$index === void 0 ? void 0 : _cards$index.id) || null);
144
146
  timedReset();
145
147
  }
146
148
 
147
149
  flipACard(index);
148
150
  }
149
151
  } else {
150
- var _cards$index;
152
+ var _cards$index2;
151
153
 
152
154
  // fails and resets
153
- handleError(((_cards$index = cards[index]) === null || _cards$index === void 0 ? void 0 : _cards$index.id) || null);
155
+ handleError(((_cards$index2 = cards[index]) === null || _cards$index2 === void 0 ? void 0 : _cards$index2.id) || null);
154
156
  flipACard(index);
155
157
  timedFlipped();
156
158
  }
@@ -180,9 +180,21 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
180
180
  return redCard.id === cardId;
181
181
  });
182
182
  setRightPick(false);
183
- setFeedBackText(failedCard.desc);
184
- setFeedbackIsShown(true);
185
- setRewards([].concat(_toConsumableArray(accRewards), [failedCard === null || failedCard === void 0 ? void 0 : failedCard.rewards]));
183
+
184
+ if (failedCard) {
185
+ setFeedBackText(failedCard.desc);
186
+ setFeedbackIsShown(true);
187
+ setRewards([].concat(_toConsumableArray(accRewards), [failedCard === null || failedCard === void 0 ? void 0 : failedCard.rewards]));
188
+ } else {
189
+ setFeedbackIsShown(true);
190
+ setTimeout(function () {
191
+ handleFeedbackFuncionOnClose();
192
+ emitEvent({
193
+ type: 'hidePuzzleButtons',
194
+ payload: false
195
+ });
196
+ }, 3000);
197
+ }
186
198
  } // si hay feedback definido
187
199
  else if (info.solution.wrong.desc) {
188
200
  setFeedBackText(info.solution.wrong.desc);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "1.4.17",
5
+ "version": "1.4.18",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",