@gamelearn/arcade-components 1.4.21 → 1.4.22
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.
package/dist/components/cards-selector-puzzle-component/components/CardsSelectorPuzzleComponent.js
CHANGED
|
@@ -178,7 +178,7 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
178
178
|
|
|
179
179
|
setRightPick(true);
|
|
180
180
|
setFeedbackIsShown(true);
|
|
181
|
-
setRewards([].concat(_toConsumableArray(accRewards),
|
|
181
|
+
setRewards([].concat(_toConsumableArray(accRewards), _toConsumableArray(pickedCard === null || pickedCard === void 0 ? void 0 : pickedCard.rewards)));
|
|
182
182
|
emitEvent({
|
|
183
183
|
type: 'hidePuzzleButtons',
|
|
184
184
|
payload: true
|
|
@@ -188,16 +188,17 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
188
188
|
|
|
189
189
|
var handleError = function handleError(cardId) {
|
|
190
190
|
// si hay feedback específico
|
|
191
|
+
setRightPick(false);
|
|
192
|
+
|
|
191
193
|
if (specificFeedbacks !== null && specificFeedbacks !== void 0 && specificFeedbacks.specificWrongFeedbacks) {
|
|
192
194
|
var failedCard = specificFeedbacks.wrongFeedbacks.find(function (redCard) {
|
|
193
195
|
return redCard.id === cardId;
|
|
194
196
|
});
|
|
195
|
-
setRightPick(false);
|
|
196
197
|
|
|
197
198
|
if (failedCard !== null && failedCard !== void 0 && failedCard.desc) {
|
|
198
199
|
setFeedBackText(failedCard.desc);
|
|
199
200
|
setFeedbackIsShown(true);
|
|
200
|
-
setRewards([].concat(_toConsumableArray(accRewards),
|
|
201
|
+
setRewards([].concat(_toConsumableArray(accRewards), _toConsumableArray(failedCard === null || failedCard === void 0 ? void 0 : failedCard.rewards)));
|
|
201
202
|
} else {
|
|
202
203
|
setFeedbackIsShown(true);
|
|
203
204
|
setTimeout(function () {
|
|
@@ -244,12 +245,14 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
|
|
|
244
245
|
}, [disableExit, finished]);
|
|
245
246
|
(0, _react.useEffect)(function () {
|
|
246
247
|
setResolveAction(function () {
|
|
248
|
+
var _info$resolve;
|
|
249
|
+
|
|
247
250
|
emitEvent({
|
|
248
251
|
type: 'hidePuzzleButtons',
|
|
249
252
|
payload: true
|
|
250
253
|
});
|
|
251
254
|
setResolvePuzzle(true);
|
|
252
|
-
var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(info.resolve.rewards));
|
|
255
|
+
var rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(info === null || info === void 0 ? void 0 : (_info$resolve = info.resolve) === null || _info$resolve === void 0 ? void 0 : _info$resolve.rewards));
|
|
253
256
|
setTimeout(function () {
|
|
254
257
|
closeFeedbackAndShowPoints(rewardsData);
|
|
255
258
|
}, 2000);
|