Premises
When creating an account, there is a final screen that allows users to select one or more categories of interest. These selected categories will be saved in the App state.
After registering an account, the user is redirected to the home page. Here, I want to display a list of the categories the user has selected. This list appears in the menu on the left side of the home page. To achieve this, I plan to query the Category collection and filter the list to only include categories that have my account referenced in the User field.
My Thoughts and Problems
Method 1: On the selection screen, when the user presses the pink confirm button, the selected categories are stored in the 'joining_category' field of the User collection. However, I also want to store a reference to the User's document in the User field of the selected Category collection. Since the App state for the selected category is in list form, it cannot be added as an action.
Method 2: Instead of adding a User field to the Category collection, I considered filtering the category list on the home page menu by referencing only the categories in which the user is participating (those registered in the 'joining_category'). This also proved to be challenging since the document itself is not singular but a list.
Please advise on which of these methods is preferable, how to solve the problem, or suggest another approach if available.