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
As always, this could be expected behaviour for a very good reason! I'm just stumbling around in the categories code and noticed something weird.
Emitting an update-categories event with an ICategoryDictionary parameter results in the category_management extension dispatching the updateCategories action. The reducer for that action just overwrites any existing categories in the persistent state. As far as I can tell, this means that it's impossible for a specific game to have categories populated from more than one source.
This same behaviour also means that an extension using retrieve-category-list to populate initial categories (I know it's supposed to be internal, but hypothetically) would completely replace the categories from Nexus Mods provided by nexus_integration
To Reproduce
Steps to reproduce the behavior:
Use the Categories dialog to pull Nexus Mods categories
Use a toolbar button/global action/whatever to emit update-categories with valid params
The categories from the event will completely replace the Nexus categories
Expected behavior
So I might be expecting this wrong, but I would have guessed that this should merge the categories into state, rather than replacing them all.
I understand that it's possible to just use the setCategory action to specifically add individual categories, but update-categories/retrieve-category-listseems like it should be the place for adding multiple categories.
Platform (please complete the following information):
OS: Windows 10
Vortex Version 1.2.16
Additional context
As always, feel free to tell me I'm doing it wrong :)
The text was updated successfully, but these errors were encountered:
This is indeed the expected behavior atm.
If you want to keep existing categories you can read what's currently there, merge with your new categories and then update-categories the merged dictionary.
retrieve-category-list will indeed replace everything already there but it's supposed to be internal and our UI for triggering it specifically says that it will replace all existing categories.
The problem is that if the api didn't replace but add categories, we would need a more complex api because then we'd have to keep track of where the categories came from so you can then "remove only categories from nexus mods"
Tbh. I'm not sure that's worth it, I wouldn't expect users to constantly sync their categories with multiple sites.
I was hoping to be able to add categories during the initial (essentially one-time) population that retrieve-category-list does, but I think it might be easier to use the the same gamemode-activated logic that the category extension uses. Then I can be sure that the Nexus integration has already run and hopefully merge them. That way I can also be sure that the Nexus implementation won't clobber my extension's categories.
Understandable if this ends up being too hard/complex, was just trying to avoid too much dirty hackery :)
Describe the bug
As always, this could be expected behaviour for a very good reason! I'm just stumbling around in the categories code and noticed something weird.
Emitting an
update-categories
event with anICategoryDictionary
parameter results in thecategory_management
extension dispatching theupdateCategories
action. The reducer for that action just overwrites any existing categories in thepersistent
state. As far as I can tell, this means that it's impossible for a specific game to have categories populated from more than one source.This same behaviour also means that an extension using
retrieve-category-list
to populate initial categories (I know it's supposed to be internal, but hypothetically) would completely replace the categories from Nexus Mods provided bynexus_integration
To Reproduce
Steps to reproduce the behavior:
update-categories
with valid paramsExpected behavior
So I might be expecting this wrong, but I would have guessed that this should merge the categories into state, rather than replacing them all.
I understand that it's possible to just use the
setCategory
action to specifically add individual categories, butupdate-categories
/retrieve-category-list
seems like it should be the place for adding multiple categories.Platform (please complete the following information):
Additional context
As always, feel free to tell me I'm doing it wrong :)
The text was updated successfully, but these errors were encountered: