@gamelearn/arcade-components 0.21.5 → 0.21.9

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.
@@ -34,6 +34,12 @@ var ImageComponent = function ImageComponent(_ref) {
34
34
  viewed = _ref.viewed,
35
35
  imgId_labelId = _ref.imgId_labelId,
36
36
  soundActions = _ref.soundActions;
37
+
38
+ var _useState = (0, _react.useState)(false),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ saved = _useState2[0],
41
+ save = _useState2[1];
42
+
37
43
  var imgUrl = img.url;
38
44
 
39
45
  var _soundActions = _slicedToArray(soundActions, 1),
@@ -54,10 +60,11 @@ var ImageComponent = function ImageComponent(_ref) {
54
60
  });
55
61
  }, [playSound, imgId_labelId, imgName, documentType, emitEvent]);
56
62
  (0, _react.useEffect)(function () {
57
- if (!visible) {
63
+ if (!visible && !saved) {
64
+ save(true);
58
65
  close();
59
66
  }
60
- }, [close, visible]);
67
+ }, [close, visible, saved]);
61
68
 
62
69
  if (!visible) {
63
70
  return null;
@@ -181,7 +181,8 @@ var RewardsComponent = function RewardsComponent(_ref) {
181
181
  };
182
182
 
183
183
  RewardsComponent.defaultProps = {
184
- rewards: []
184
+ rewards: [],
185
+ soundActions: []
185
186
  };
186
187
  var _default = RewardsComponent;
187
188
  exports.default = _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gamelearn/arcade-components",
3
3
  "license": "Gamelearn",
4
- "version": "0.21.5",
4
+ "version": "0.21.9",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",