mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-30 00:50:50 +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));
|
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;
|
return true;
|
||||||
|
@ -122,7 +122,7 @@ const useFurnitureCraftingWidgetState = () =>
|
|||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
if(!groupItems || !groupItems.length || !ingredientNames || !ingredientNames.length) return;
|
if(!ingredientNames || !ingredientNames.length) return;
|
||||||
|
|
||||||
setIngredients(prevValue =>
|
setIngredients(prevValue =>
|
||||||
{
|
{
|
||||||
@ -138,7 +138,7 @@ const useFurnitureCraftingWidgetState = () =>
|
|||||||
|
|
||||||
let amountAvailable = 0;
|
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({
|
newValue.push({
|
||||||
name: name,
|
name: name,
|
||||||
|
Loading…
Reference in New Issue
Block a user