From ea6a35231e0ef6321a9495fe3368c54f6e886ead Mon Sep 17 00:00:00 2001 From: Bob <80072466+bob0005@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:50:19 +0100 Subject: [PATCH] Change to getComponentValue (#2549) --- client/src/ui/components/resources/EntityResourceTable.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/ui/components/resources/EntityResourceTable.tsx b/client/src/ui/components/resources/EntityResourceTable.tsx index bba2e08fc..702ca2892 100644 --- a/client/src/ui/components/resources/EntityResourceTable.tsx +++ b/client/src/ui/components/resources/EntityResourceTable.tsx @@ -7,6 +7,7 @@ import { BuildingType, CapacityConfigCategory, ID, RESOURCE_TIERS, StructureType import { useComponentValue } from "@dojoengine/react"; import { useMemo } from "react"; import { ResourceChip } from "./ResourceChip"; +import { getComponentValue } from "@dojoengine/recs"; export const EntityResourceTable = ({ entityId }: { entityId: ID | undefined }) => { const dojo = useDojo(); @@ -19,8 +20,7 @@ export const EntityResourceTable = ({ entityId }: { entityId: ID | undefined }) getEntityIdFromKeys([BigInt(entityId || 0), BigInt(BuildingType.Storehouse)]), )?.value || 0; - const { getStructureByEntityId } = useStructures(); - const structure = getStructureByEntityId(entityId || 0); + const structure = getComponentValue(dojo.setup.components.Structure, getEntityIdFromKeys([BigInt(entityId || 0)])); const maxStorehouseCapacityKg = useMemo(() => { if (structure?.category === StructureType[StructureType.FragmentMine]) return Infinity;