mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-22 22:30:52 +01:00
Fix crafting
This commit is contained in:
parent
22d3ff32a2
commit
f7f57e1f55
@ -24,7 +24,8 @@ export const FurnitureCraftingView: FC<{}> = props =>
|
||||
{
|
||||
const ingredientData = ingredients.find(data => (data.name === ingredient.itemName));
|
||||
|
||||
if (ingredientData.count < ingredient.count) return false;
|
||||
|
||||
if (!ingredientData || ingredientData.count < ingredient.count) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -122,7 +122,7 @@ const useFurnitureCraftingWidgetState = () =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
if(!groupItems || !groupItems.length || !ingredientNames || !ingredientNames.length) return;
|
||||
if(!ingredientNames || !ingredientNames.length) return;
|
||||
|
||||
setIngredients(prevValue =>
|
||||
{
|
||||
@ -138,7 +138,7 @@ const useFurnitureCraftingWidgetState = () =>
|
||||
|
||||
let amountAvailable = 0;
|
||||
|
||||
for (const inventoryItem of inventoryItems) amountAvailable += inventoryItem.items.length;
|
||||
if (inventoryItems) for (const inventoryItem of inventoryItems) amountAvailable += inventoryItem.items.length;
|
||||
|
||||
newValue.push({
|
||||
name: name,
|
||||
|
Loading…
Reference in New Issue
Block a user