You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: string.charAt is not a function at VueComponent.capitalizeFirstLetter
Stats tab is not showing skills
If the current behavior is a bug, please provide the exact steps to reproduce.
login into the game (I'm using the guest login)
open the console
observe the error
*if the error doesn't appear try moving the player around a bit
What is the expected behavior?
No error
When clicking the stats tab in the right pane, observe a list of skills
Additional context
This error seems to be due to the behavior of the v-for in Stats.vue . My Vue is a little rusty, but I believe the syntax used is suitable for working with object properties, whereas the stats are received as an array.
This results in capitalizeFirstLetter method getting the number 0 and failing.
To fix the issue, the v-for should probably be on skill in skills and the capitalizeFirstLetter method should receive skill.name
*capitalizeFirstLetter should protect itself by addressing cases where non string input is received is not a string. Alternatively we can replace it with css text-transform: capitalize.
@naknode
I'm opening new issues for new things I encounter if I'm submitting a pull request shortly after. I think I read somewhere that pull requests will only be accepted for issues, and even if not, I thought it's a good such things documented. Please let me know if you want me to keep doing that or just submit a pull request.
The text was updated successfully, but these errors were encountered:
erezvish
added a commit
to erezvish/game
that referenced
this issue
Mar 3, 2019
…r - fixed v-for in Stats.vue to work as expected. removed captializing method and replaced with a css class. Also updated player.json and added _id to skills
What is the current behavior?
If the current behavior is a bug, please provide the exact steps to reproduce.
*if the error doesn't appear try moving the player around a bit
What is the expected behavior?
Additional context
This error seems to be due to the behavior of the v-for in Stats.vue . My Vue is a little rusty, but I believe the syntax used is suitable for working with object properties, whereas the stats are received as an array.
This results in capitalizeFirstLetter method getting the number 0 and failing.
To fix the issue, the v-for should probably be on skill in skills and the capitalizeFirstLetter method should receive skill.name
*capitalizeFirstLetter should protect itself by addressing cases where non string input is received is not a string. Alternatively we can replace it with css text-transform: capitalize.
@naknode
I'm opening new issues for new things I encounter if I'm submitting a pull request shortly after. I think I read somewhere that pull requests will only be accepted for issues, and even if not, I thought it's a good such things documented. Please let me know if you want me to keep doing that or just submit a pull request.
The text was updated successfully, but these errors were encountered: