Closed Napokue closed 1 year ago
Alternative solution 3 - Change the JSON export
Probably the highest impact one, but a possible solution would be change the JSON export of the plugin and always include all the categories (i.e. the tabs). This would solve the problem at frontend.
This is in the works. I'm making some changes to how the plugin gathers information from the in-game collection log, which will get all tabs/pages/items that exist in the log on it's own, rather than depending on the end user to click through all the pages to get that information. Those changes are still in testing. I'm not sure exactly when they'll get pushed out since there's a whole bunch of other changes that are being included in that specific update, but sooner rather than later.
That being said, I'll get this merged. It's definitely something that is needed. I appreciate the contribution.
Description
While uploading my character for the first time, the page errored (and I have found out that it happens quite a lot with other characters too). My character for reference in production.
Reason for this is that my character's JSON does not have at least one collection from each of the tabs.
Proposed solution - Only showing available tabs
Currently solution that I provide here with the PR is choosing to not show the tabs that my character for instance does not have. This causes the bug to be fixed.
However, there is a downside to this solution and that is the user is not able to see the other tabs for them self and causes another user experience than other users.
Alternative solution 1 - Show all tabs disabled
A possible solution would be to still show all tabs, while not having the tabs available in the collectionLog object. A check will be created that checks what tabs the user has data for and show those tabs enabled, while showing the tabs that don't have data as disabled.
Alternative solution 2 - Show all tabs enabled with all data
Another possible solution will be to make always all tabs, entries, items available via a static way. Maybe having them retrieved once for a user from an API and cache it for some time.
Alternative solution 3 - Change the JSON export
Probably the highest impact one, but a possible solution would be change the JSON export of the plugin and always include all the categories (i.e. the tabs). This would solve the problem at frontend.
My export JSON