@gamelearn/arcade-components 1.4.17 → 1.4.19
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$
|
|
152
|
+
var _cards$index2;
|
|
151
153
|
|
|
152
154
|
// fails and resets
|
|
153
|
-
handleError(((_cards$
|
|
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
|
}
|
package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js
CHANGED
|
@@ -162,7 +162,20 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
162
162
|
var pickedCard = specificFeedbacks.correctFeedbacks.find(function (greenCard) {
|
|
163
163
|
return greenCard.id === cardId;
|
|
164
164
|
});
|
|
165
|
-
|
|
165
|
+
|
|
166
|
+
if (pickedCard !== null && pickedCard !== void 0 && pickedCard.desc) {
|
|
167
|
+
setFeedBackText(pickedCard.desc);
|
|
168
|
+
} else {
|
|
169
|
+
setTimeout(function () {
|
|
170
|
+
playSound('score');
|
|
171
|
+
handleFeedbackFuncionOnClose();
|
|
172
|
+
emitEvent({
|
|
173
|
+
type: 'hidePuzzleButtons',
|
|
174
|
+
payload: false
|
|
175
|
+
});
|
|
176
|
+
}, 2000);
|
|
177
|
+
}
|
|
178
|
+
|
|
166
179
|
setRightPick(true);
|
|
167
180
|
setFeedbackIsShown(true);
|
|
168
181
|
setRewards([].concat(_toConsumableArray(accRewards), [pickedCard === null || pickedCard === void 0 ? void 0 : pickedCard.rewards]));
|
|
@@ -180,8 +193,21 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
180
193
|
return redCard.id === cardId;
|
|
181
194
|
});
|
|
182
195
|
setRightPick(false);
|
|
183
|
-
|
|
184
|
-
|
|
196
|
+
|
|
197
|
+
if (failedCard !== null && failedCard !== void 0 && failedCard.desc) {
|
|
198
|
+
setFeedBackText(failedCard.desc);
|
|
199
|
+
setFeedbackIsShown(true);
|
|
200
|
+
} else {
|
|
201
|
+
setFeedbackIsShown(true);
|
|
202
|
+
setTimeout(function () {
|
|
203
|
+
handleFeedbackFuncionOnClose();
|
|
204
|
+
emitEvent({
|
|
205
|
+
type: 'hidePuzzleButtons',
|
|
206
|
+
payload: false
|
|
207
|
+
});
|
|
208
|
+
}, 2000);
|
|
209
|
+
}
|
|
210
|
+
|
|
185
211
|
setRewards([].concat(_toConsumableArray(accRewards), [failedCard === null || failedCard === void 0 ? void 0 : failedCard.rewards]));
|
|
186
212
|
} // si hay feedback definido
|
|
187
213
|
else if (info.solution.wrong.desc) {
|