BibliothecaDAO / eternum

onchain eternal game
https://alpha-eternum.realms.world
MIT License
36 stars 30 forks source link

fix error #1041

Closed aymericdelab closed 5 days ago

aymericdelab commented 5 days ago

PR Type

Bug fix


Description


Changes walkthrough ๐Ÿ“

Relevant files
Bug fix
ArmyList.tsx
Corrected parameter for `getResourcesFromBalance` function call

client/src/ui/components/military/ArmyList.tsx - Fixed the parameter passed to `getResourcesFromBalance` function.
+1/-1     

๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

vercel[bot] commented 5 days ago

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Comments Updated (UTC)
eternum โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Jun 28, 2024 2:31pm
github-actions[bot] commented 5 days ago

PR Reviewer Guide ๐Ÿ”

โฑ๏ธ Estimated effort to review [1-5] 1
๐Ÿงช Relevant tests No
๐Ÿ”’ Security concerns No
โšก Key issues to review None
github-actions[bot] commented 5 days ago

PR Code Suggestions โœจ

CategorySuggestion                                                                                                                                    Score
Possible bug
Ensure the correct property of entity_id is used in the function call ___ **It seems there might be a misunderstanding in the usage of entity_id object. The original
code used entity_id directly, but the new code attempts to access entity_id.entity_id.
Ensure that the correct property is being accessed for getResourcesFromBalance function.** [client/src/ui/components/military/ArmyList.tsx [32]](https://github.com/BibliothecaDAO/eternum/pull/1041/files#diff-19286ac1f005ea8e13dda2e8ba0752bff5920fcf501f94c636608e4b6f4466a3R32-R32) ```diff -const inventoryResources = getResourcesFromBalance(entity_id?.entity_id); +const inventoryResources = getResourcesFromBalance(entity_id); ```
Suggestion importance[1-10]: 9 Why: The suggestion correctly identifies a potential bug where the new code accesses `entity_id.entity_id` instead of `entity_id`. This could lead to unexpected behavior if `entity_id` is not an object with an `entity_id` property.
9