@micromag/consent 0.3.707 → 0.3.709

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.
Files changed (2) hide show
  1. package/es/index.js +5 -3
  2. package/package.json +4 -4
package/es/index.js CHANGED
@@ -49,10 +49,12 @@ var useConsentActions = function useConsentActions(_ref) {
49
49
  autoClose = _ref$autoClose === void 0 ? true : _ref$autoClose;
50
50
  var _useConsent = useConsent(),
51
51
  consent = _useConsent.consent,
52
- setConsent = _useConsent.setConsent;
52
+ setConsent = _useConsent.setConsent,
53
+ setConsented = _useConsent.setConsented;
53
54
  var onSubmitForm = useCallback(function () {
54
55
  var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
55
56
  setConsent(values);
57
+ setConsented(true);
56
58
  if (onSubmit !== null) {
57
59
  onSubmit(values || []);
58
60
  }
@@ -84,7 +86,7 @@ var useConsentActions = function useConsentActions(_ref) {
84
86
  });
85
87
  });
86
88
  onSubmitForm(items);
87
- }, [onSubmitForm]);
89
+ }, [consent, onSubmitForm]);
88
90
  var onClickDeny = useCallback(function () {
89
91
  var items = (consent || []).map(function (it) {
90
92
  return _objectSpread(_objectSpread({}, it), {}, {
@@ -92,7 +94,7 @@ var useConsentActions = function useConsentActions(_ref) {
92
94
  });
93
95
  });
94
96
  onSubmitForm(items);
95
- }, [onSubmitForm]);
97
+ }, [consent, onSubmitForm]);
96
98
  return {
97
99
  consent: consent,
98
100
  onClickChoice: onClickChoice,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/consent",
3
- "version": "0.3.707",
3
+ "version": "0.3.709",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -63,8 +63,8 @@
63
63
  "@fortawesome/fontawesome-svg-core": "^6.5.2",
64
64
  "@fortawesome/free-solid-svg-icons": "^6.5.2",
65
65
  "@fortawesome/react-fontawesome": "^0.2.0",
66
- "@micromag/core": "^0.3.707",
67
- "@micromag/data": "^0.3.707",
66
+ "@micromag/core": "^0.3.709",
67
+ "@micromag/data": "^0.3.709",
68
68
  "bootstrap": "^5.3.7",
69
69
  "classnames": "^2.2.6",
70
70
  "lodash": "^4.17.21",
@@ -76,5 +76,5 @@
76
76
  "access": "public",
77
77
  "registry": "https://registry.npmjs.org/"
78
78
  },
79
- "gitHead": "e3afa5fe973a68bf83383fede41590a5e6428259"
79
+ "gitHead": "367f9fd8ecf298da947c017e9a0434e34c90e248"
80
80
  }