@rpg-engine/long-bow 0.5.91 → 0.5.92

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.
@@ -14793,6 +14793,9 @@ var CraftBook = function CraftBook(_ref) {
14793
14793
  var _useState3 = React.useState(),
14794
14794
  size = _useState3[0],
14795
14795
  setSize = _useState3[1];
14796
+ var _useState4 = React.useState(false),
14797
+ isCraftingDisabled = _useState4[0],
14798
+ setIsCraftingDisabled = _useState4[1];
14796
14799
  React.useEffect(function () {
14797
14800
  var handleResize = function handleResize() {
14798
14801
  if (window.innerWidth < 500 && (size == null ? void 0 : size.width) !== mobilePortrait.width && (!scale || scale < 1)) {
@@ -14897,10 +14900,15 @@ var CraftBook = function CraftBook(_ref) {
14897
14900
  buttonType: exports.ButtonTypes.RPGUIButton,
14898
14901
  onPointerDown: onClose
14899
14902
  }, "Cancel"), React__default.createElement(Button, {
14900
- disabled: !craftItemKey,
14903
+ disabled: !craftItemKey || isCraftingDisabled,
14901
14904
  buttonType: exports.ButtonTypes.RPGUIButton,
14902
14905
  onPointerDown: function onPointerDown() {
14903
- return onCraftItem(craftItemKey);
14906
+ if (!craftItemKey || isCraftingDisabled) return;
14907
+ onCraftItem(craftItemKey);
14908
+ setIsCraftingDisabled(true);
14909
+ setTimeout(function () {
14910
+ setIsCraftingDisabled(false);
14911
+ }, 2000);
14904
14912
  }
14905
14913
  }, "Craft"))));
14906
14914
  };