@gamelearn/arcade-components 2.37.1 → 2.37.2

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.
@@ -97,7 +97,7 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
97
97
  });
98
98
  }, [emitEvent]);
99
99
  var endPuzzle = (0, _react.useCallback)(function () {
100
- var _info$solution, _specificFeedbacks$co;
100
+ var _info$solution;
101
101
  emitEvent({
102
102
  type: 'hidePuzzleButtons',
103
103
  payload: true
@@ -105,20 +105,21 @@ var CardsSelectorPuzzleComponent = function CardsSelectorPuzzleComponent(_ref) {
105
105
  setFeedbackResult(true);
106
106
  var _info$solution$right = info === null || info === void 0 ? void 0 : (_info$solution = info.solution) === null || _info$solution === void 0 ? void 0 : _info$solution.right,
107
107
  rewards = _info$solution$right.rewards;
108
- var specificRewards = (specificFeedbacks === null || specificFeedbacks === void 0 ? void 0 : (_specificFeedbacks$co = specificFeedbacks.correctFeedbacks) === null || _specificFeedbacks$co === void 0 ? void 0 : _specificFeedbacks$co.map(function (spReward) {
109
- return spReward.rewards;
110
- }).flat()) || [];
111
108
  var rewardsData = [];
112
109
  playSound('score');
113
110
  if (resolveWithAnyCard) {
114
- rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards), _toConsumableArray(specificRewards));
115
- } else {
116
- var _specificRewards$corr;
117
- var cardFeedback = (specificRewards === null || specificRewards === void 0 ? void 0 : (_specificRewards$corr = specificRewards.correctFeedbacks) === null || _specificRewards$corr === void 0 ? void 0 : _specificRewards$corr.find(function (feedback) {
111
+ var _specificFeedbacks$co;
112
+ var cardFeedback = (specificFeedbacks === null || specificFeedbacks === void 0 ? void 0 : (_specificFeedbacks$co = specificFeedbacks.correctFeedbacks) === null || _specificFeedbacks$co === void 0 ? void 0 : _specificFeedbacks$co.find(function (feedback) {
118
113
  return cardSelected.id === feedback.id;
119
114
  })) || {};
120
115
  var cardReward = cardFeedback && cardFeedback.rewards ? cardFeedback.rewards : [];
121
116
  rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards), _toConsumableArray(cardReward));
117
+ } else {
118
+ var _specificFeedbacks$co2;
119
+ var specificRewards = (specificFeedbacks === null || specificFeedbacks === void 0 ? void 0 : (_specificFeedbacks$co2 = specificFeedbacks.correctFeedbacks) === null || _specificFeedbacks$co2 === void 0 ? void 0 : _specificFeedbacks$co2.map(function (spReward) {
120
+ return spReward.rewards;
121
+ }).flat()) || [];
122
+ rewardsData = [].concat(_toConsumableArray(accRewards), _toConsumableArray(rewards), _toConsumableArray(specificRewards));
122
123
  }
123
124
  closeFeedbackAndShowPoints(rewardsData);
124
125
  }, [accRewards, closeFeedbackAndShowPoints, emitEvent, info === null || info === void 0 ? void 0 : (_info$solution2 = info.solution) === null || _info$solution2 === void 0 ? void 0 : _info$solution2.right, playSound, specificFeedbacks === null || specificFeedbacks === void 0 ? void 0 : specificFeedbacks.correctFeedbacks, resolveWithAnyCard, cardSelected]);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "author": "Gamelearn",
4
4
  "license": "unlicense",
5
- "version": "2.37.1",
5
+ "version": "2.37.2",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",