From 2776a3849433c5b0e7f3c08dba8f415b2f212fd8 Mon Sep 17 00:00:00 2001 From: ponderingdemocritus Date: Sun, 15 Dec 2024 11:39:11 +1100 Subject: [PATCH] lint --- client/src/dojo/queries.ts | 2 +- client/src/hooks/helpers/useArmies.tsx | 41 ++++---- client/src/three/scenes/Worldmap.ts | 98 +++++++++---------- .../resources/InventoryResources.tsx | 6 +- .../ui/components/resources/TravelInfo.tsx | 6 +- client/src/ui/layouts/World.tsx | 14 +-- client/src/ui/utils/utils.tsx | 2 +- landing/src/components/modules/bridge-in.tsx | 9 +- .../src/components/modules/realms-grid.tsx | 28 +++--- .../components/modules/season-passes-grid.tsx | 24 +++-- 10 files changed, 115 insertions(+), 115 deletions(-) diff --git a/client/src/dojo/queries.ts b/client/src/dojo/queries.ts index fe44ebfd2..0514e4f57 100644 --- a/client/src/dojo/queries.ts +++ b/client/src/dojo/queries.ts @@ -106,7 +106,7 @@ export const addMarketSubscription = async ( }, }, components, - 30_000, + 30_000, false, ); }; diff --git a/client/src/hooks/helpers/useArmies.tsx b/client/src/hooks/helpers/useArmies.tsx index a20fb1886..617eea3ff 100644 --- a/client/src/hooks/helpers/useArmies.tsx +++ b/client/src/hooks/helpers/useArmies.tsx @@ -120,7 +120,8 @@ const formatArmies = ( const structure = getComponentValue(Structure, getEntityIdFromKeys([BigInt(entityOwner.entity_owner_id)])); - const structurePosition = structure && getComponentValue(Position, getEntityIdFromKeys([BigInt(structure.entity_id)])); + const structurePosition = + structure && getComponentValue(Position, getEntityIdFromKeys([BigInt(structure.entity_id)])); const isMine = (owner?.address || 0n) === ContractAddress(playerAddress); const isMercenary = owner === undefined; @@ -171,7 +172,7 @@ export const useArmiesByEntityOwner = ({ entity_owner_entity_id }: { entity_owne Protectee, EntityName, Stamina, - Structure + Structure, }, }, account: { account }, @@ -197,7 +198,7 @@ export const useArmiesByEntityOwner = ({ entity_owner_entity_id }: { entity_owne Owner, Realm, Stamina, - Structure + Structure, ); }, [armies]); @@ -228,7 +229,7 @@ export const useArmiesByEntityOwnerWithPositionAndQuantity = ({ Protectee, EntityName, Stamina, - Structure + Structure, }, }, account: { account }, @@ -259,7 +260,7 @@ export const useArmiesByEntityOwnerWithPositionAndQuantity = ({ Owner, Realm, Stamina, - Structure + Structure, ); }, [armies]); @@ -286,7 +287,7 @@ export const getArmiesByBattleId = () => { Protectee, EntityName, Stamina, - Structure + Structure, }, }, account: { account }, @@ -311,7 +312,7 @@ export const getArmiesByBattleId = () => { Owner, Realm, Stamina, - Structure + Structure, ); }; return armiesByBattleId; @@ -335,7 +336,7 @@ export const useArmyByArmyEntityId = (entityId: ID): ArmyInfo | undefined => { Protectee, EntityName, Stamina, - Structure + Structure, }, }, account: { account }, @@ -359,7 +360,7 @@ export const useArmyByArmyEntityId = (entityId: ID): ArmyInfo | undefined => { Owner, Realm, Stamina, - Structure + Structure, )[0]; }; @@ -382,7 +383,7 @@ export const getUserArmyInBattle = (battle_id: ID) => { Protectee, EntityName, Stamina, - Structure + Structure, }, }, } = useDojo(); @@ -412,7 +413,7 @@ export const getUserArmyInBattle = (battle_id: ID) => { Owner, Realm, Stamina, - Structure + Structure, )[0]; }, [battle_id]); @@ -447,7 +448,7 @@ export const useOwnArmiesByPosition = ({ Protectee, EntityName, Stamina, - Structure + Structure, }, }, } = useDojo(); @@ -477,7 +478,7 @@ export const useOwnArmiesByPosition = ({ Owner, Realm, Stamina, - Structure + Structure, ).filter((army) => playerStructures.some((structure) => structure.entity_id === army.entityOwner.entity_owner_id), ); @@ -513,7 +514,7 @@ export const useEnemyArmiesByPosition = ({ Protectee, EntityName, Stamina, - Structure + Structure, }, }, } = useDojo(); @@ -542,7 +543,7 @@ export const useEnemyArmiesByPosition = ({ Owner, Realm, Stamina, - Structure + Structure, ).filter((army) => playerStructures.every((structure) => structure.entity_id !== army.entityOwner.entity_owner_id), ); @@ -570,7 +571,7 @@ export const getArmyByEntityId = () => { Protectee, EntityName, Stamina, - Structure + Structure, }, }, account: { account }, @@ -595,7 +596,7 @@ export const getArmyByEntityId = () => { Owner, Realm, Stamina, - Structure + Structure, )[0]; }; @@ -619,7 +620,7 @@ export const getArmyByEntityId = () => { Owner, Realm, Stamina, - Structure + Structure, )[0]; }; @@ -645,7 +646,7 @@ export const getArmiesByPosition = () => { Protectee, EntityName, Stamina, - Structure + Structure, }, }, } = useDojo(); @@ -669,7 +670,7 @@ export const getArmiesByPosition = () => { Owner, Realm, Stamina, - Structure + Structure, ); }; diff --git a/client/src/three/scenes/Worldmap.ts b/client/src/three/scenes/Worldmap.ts index e5e06babb..e747f43c9 100644 --- a/client/src/three/scenes/Worldmap.ts +++ b/client/src/three/scenes/Worldmap.ts @@ -680,63 +680,63 @@ export default class WorldmapScene extends HexagonScene { // Skip if we've already fetched this chunk if (this.fetchedChunks.has(chunkKey)) { - console.log("Already fetched"); - return; + console.log("Already fetched"); + return; } // Add to fetched chunks before the query to prevent concurrent duplicate requests this.fetchedChunks.add(chunkKey); try { - await getEntities( - this.dojo.network.toriiClient, - { - Composite: { - operator: "And", - clauses: [ - { - Member: { - model: "s0_eternum-Tile", - member: "col", - operator: "Gte", - value: { Primitive: { U32: startCol - range } }, - }, - }, - { - Member: { - model: "s0_eternum-Tile", - member: "col", - operator: "Lte", - value: { Primitive: { U32: startCol + range } }, - }, - }, - { - Member: { - model: "s0_eternum-Tile", - member: "row", - operator: "Gte", - value: { Primitive: { U32: startRow - range } }, - }, - }, - { - Member: { - model: "s0_eternum-Tile", - member: "row", - operator: "Lte", - value: { Primitive: { U32: startRow + range } }, - }, - }, - ], + await getEntities( + this.dojo.network.toriiClient, + { + Composite: { + operator: "And", + clauses: [ + { + Member: { + model: "s0_eternum-Tile", + member: "col", + operator: "Gte", + value: { Primitive: { U32: startCol - range } }, + }, + }, + { + Member: { + model: "s0_eternum-Tile", + member: "col", + operator: "Lte", + value: { Primitive: { U32: startCol + range } }, + }, + }, + { + Member: { + model: "s0_eternum-Tile", + member: "row", + operator: "Gte", + value: { Primitive: { U32: startRow - range } }, }, - }, - this.dojo.network.contractComponents as any, - 1000, - false, - ); + }, + { + Member: { + model: "s0_eternum-Tile", + member: "row", + operator: "Lte", + value: { Primitive: { U32: startRow + range } }, + }, + }, + ], + }, + }, + this.dojo.network.contractComponents as any, + 1000, + false, + ); } catch (error) { - // If there's an error, remove the chunk from cached set so it can be retried - this.fetchedChunks.delete(chunkKey); - console.error('Error fetching tile entities:', error); + // If there's an error, remove the chunk from cached set so it can be retried + this.fetchedChunks.delete(chunkKey); + console.error("Error fetching tile entities:", error); } } diff --git a/client/src/ui/components/resources/InventoryResources.tsx b/client/src/ui/components/resources/InventoryResources.tsx index 8136bef67..8f555fda6 100644 --- a/client/src/ui/components/resources/InventoryResources.tsx +++ b/client/src/ui/components/resources/InventoryResources.tsx @@ -51,11 +51,7 @@ export const InventoryResources = ({ setIsSyncing(true); try { - await addToSubscription( - dojo.network.toriiClient, - dojo.network.contractComponents as any, - entityId.toString(), - ); + await addToSubscription(dojo.network.toriiClient, dojo.network.contractComponents as any, entityId.toString()); localStorage.setItem(cacheKey, now.toString()); } catch (error) { console.error("Fetch failed", error); diff --git a/client/src/ui/components/resources/TravelInfo.tsx b/client/src/ui/components/resources/TravelInfo.tsx index 482b78dab..26cf06500 100644 --- a/client/src/ui/components/resources/TravelInfo.tsx +++ b/client/src/ui/components/resources/TravelInfo.tsx @@ -46,7 +46,7 @@ export const TravelInfo = ({ setDonkeyBalance(calculatedDonkeyBalance); const onlyDonkeysAndLords = resources.every( - (r) => r.resourceId === ResourcesIds.Donkey || r.resourceId === ResourcesIds.Lords + (r) => r.resourceId === ResourcesIds.Donkey || r.resourceId === ResourcesIds.Lords, ); if (setCanCarry) { @@ -66,7 +66,9 @@ export const TravelInfo = ({ {`${Math.floor(travelTime / 60)} hrs ${travelTime % 60} mins`} - ):''} + ) : ( + "" + )} Total Transfer Weight {`${currencyFormat( diff --git a/client/src/ui/layouts/World.tsx b/client/src/ui/layouts/World.tsx index 87c966e09..e0909a8f1 100644 --- a/client/src/ui/layouts/World.tsx +++ b/client/src/ui/layouts/World.tsx @@ -159,13 +159,13 @@ export const World = ({ backgroundImage }: { backgroundImage: string }) => { console.log("world loading", worldLoading); - try { - await addMarketSubscription(dojo.network.toriiClient, dojo.network.contractComponents as any); - } catch (error) { - console.error("Fetch failed", error); - } finally { - setMarketLoading(false); - } + try { + await addMarketSubscription(dojo.network.toriiClient, dojo.network.contractComponents as any); + } catch (error) { + console.error("Fetch failed", error); + } finally { + setMarketLoading(false); + } }; fetch(); diff --git a/client/src/ui/utils/utils.tsx b/client/src/ui/utils/utils.tsx index eba5075da..e565ab35e 100644 --- a/client/src/ui/utils/utils.tsx +++ b/client/src/ui/utils/utils.tsx @@ -523,7 +523,7 @@ export const getSeasonAddresses = async (): Promise => { console.error("Error loading season addresses:", error); return {}; } -} +}; export const calculateDonkeysNeeded = (orderWeight: number): number => { const configManager = ClientConfigManager.instance(); const donkeyCapacityGrams = configManager.getCapacityConfig(CapacityConfigCategory.Donkey); diff --git a/landing/src/components/modules/bridge-in.tsx b/landing/src/components/modules/bridge-in.tsx index fe9b56cdc..2de6a3aef 100644 --- a/landing/src/components/modules/bridge-in.tsx +++ b/landing/src/components/modules/bridge-in.tsx @@ -226,7 +226,14 @@ export const BridgeIn = () => {
To Realm