diff --git a/client/apps/game/src/three/scenes/worldmap.ts b/client/apps/game/src/three/scenes/worldmap.ts index 8a0060ebc..6bfcc103d 100644 --- a/client/apps/game/src/three/scenes/worldmap.ts +++ b/client/apps/game/src/three/scenes/worldmap.ts @@ -190,15 +190,13 @@ export default class WorldmapScene extends HexagonScene { if (this.isNavigationViewOpen()) { this.closeNavigationViews(); } else { - this.clearEntitySelection(); - this.clearHexSelection(); + this.clearSelection(); } } }); window.addEventListener("urlChanged", () => { - this.clearEntitySelection(); - this.clearHexSelection(); + this.clearSelection(); }); } @@ -313,7 +311,7 @@ export default class WorldmapScene extends HexagonScene { this.clearCache(); this.updateVisibleChunks(true); }); - this.clearEntitySelection(); + this.clearSelection(); } protected handleHexSelection(hexCoords: HexPosition) { @@ -368,7 +366,7 @@ export default class WorldmapScene extends HexagonScene { private onArmySelection(selectedEntityId: ID | null) { if (!selectedEntityId) { - this.clearEntitySelection(); + this.clearSelection(); return; } @@ -384,13 +382,11 @@ export default class WorldmapScene extends HexagonScene { this.highlightHexManager.highlightHexes(travelPaths.getHighlightedHexes()); } - private clearEntitySelection() { + private clearSelection() { this.highlightHexManager.highlightHexes([]); this.state.updateTravelPaths(new Map()); this.structurePreview?.clearPreviewStructure(); - } - - private clearHexSelection() { + this.state.updateSelectedEntityId(null); this.state.setSelectedHex(null); } diff --git a/client/apps/game/src/ui/components/trading/resource-arrivals.tsx b/client/apps/game/src/ui/components/trading/resource-arrivals.tsx index 8e863a340..daf986572 100644 --- a/client/apps/game/src/ui/components/trading/resource-arrivals.tsx +++ b/client/apps/game/src/ui/components/trading/resource-arrivals.tsx @@ -47,9 +47,9 @@ export const AllResourceArrivals = memo( addSubscribedIds(unsubscribedIds); // Move API call outside of state updates - getEntitiesFromTorii(dojo.network.toriiClient, dojo.network.contractComponents as any, unsubscribedIds, ["s1_eternum-DetachedResource"]).catch( - (error) => console.error("Fetch failed", error), - ); + getEntitiesFromTorii(dojo.network.toriiClient, dojo.network.contractComponents as any, unsubscribedIds, [ + "s1_eternum-DetachedResource", + ]).catch((error) => console.error("Fetch failed", error)); console.log("AddToSubscriptionStart - 5"); }, [arrivals, subscribedIds, addSubscribedIds]);