@ornikar/kitt-universal 25.55.0 → 25.56.0
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/CHANGELOG.md +9 -0
- package/dist/definitions/Actions/ActionsItem.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +6 -1
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +6 -1
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-20.10.cjs.js +6 -1
- package/dist/index-node-20.10.cjs.js.map +1 -1
- package/dist/index-node-20.10.cjs.web.js +6 -1
- package/dist/index-node-20.10.cjs.web.js.map +1 -1
- package/dist/index-node-20.10.es.mjs +6 -1
- package/dist/index-node-20.10.es.mjs.map +1 -1
- package/dist/index-node-20.10.es.web.mjs +6 -1
- package/dist/index-node-20.10.es.web.mjs.map +1 -1
- package/dist/index.es.js +15 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +15 -10
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.es.web.js
CHANGED
|
@@ -3625,6 +3625,8 @@ var ActionsItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3625
3625
|
isLoading = _useState2[0],
|
|
3626
3626
|
setIsLoading = _useState2[1];
|
|
3627
3627
|
var mountedRef = useRef(false);
|
|
3628
|
+
// securing the loading state with a ref to avoid user action between rerenders
|
|
3629
|
+
var loadingRef = useRef(false);
|
|
3628
3630
|
|
|
3629
3631
|
// effect just for tracking mounted state, as onPress can unmount the ActionButton
|
|
3630
3632
|
useEffect(function () {
|
|
@@ -3646,34 +3648,37 @@ var ActionsItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3646
3648
|
return _regeneratorRuntime().wrap(function (_context) {
|
|
3647
3649
|
while (1) switch (_context.prev = _context.next) {
|
|
3648
3650
|
case 0:
|
|
3649
|
-
if (onPress) {
|
|
3651
|
+
if (!(!onPress || loadingRef.current)) {
|
|
3650
3652
|
_context.next = 2;
|
|
3651
3653
|
break;
|
|
3652
3654
|
}
|
|
3653
3655
|
return _context.abrupt("return");
|
|
3654
3656
|
case 2:
|
|
3655
3657
|
setIsLoading(true);
|
|
3656
|
-
|
|
3657
|
-
_context.
|
|
3658
|
+
loadingRef.current = true;
|
|
3659
|
+
_context.prev = 4;
|
|
3660
|
+
_context.next = 7;
|
|
3658
3661
|
return onPress(e);
|
|
3659
|
-
case
|
|
3662
|
+
case 7:
|
|
3660
3663
|
if (mountedRef.current) {
|
|
3661
3664
|
setIsLoading(false);
|
|
3665
|
+
loadingRef.current = false;
|
|
3662
3666
|
}
|
|
3663
|
-
_context.next =
|
|
3667
|
+
_context.next = 14;
|
|
3664
3668
|
break;
|
|
3665
|
-
case
|
|
3666
|
-
_context.prev =
|
|
3667
|
-
_context.t0 = _context["catch"](
|
|
3669
|
+
case 10:
|
|
3670
|
+
_context.prev = 10;
|
|
3671
|
+
_context.t0 = _context["catch"](4);
|
|
3668
3672
|
if (mountedRef.current) {
|
|
3673
|
+
loadingRef.current = false;
|
|
3669
3674
|
setIsLoading(false);
|
|
3670
3675
|
}
|
|
3671
3676
|
throw _context.t0;
|
|
3672
|
-
case
|
|
3677
|
+
case 14:
|
|
3673
3678
|
case "end":
|
|
3674
3679
|
return _context.stop();
|
|
3675
3680
|
}
|
|
3676
|
-
}, _callee, null, [[
|
|
3681
|
+
}, _callee, null, [[4, 10]]);
|
|
3677
3682
|
}));
|
|
3678
3683
|
return function () {
|
|
3679
3684
|
return _ref2.apply(this, arguments);
|