Refactored onSnapshot for user role update. Changed z-index for the menu bar that was overlapping on the map chart. And removed some unnecessary code/file.
From:
Performance: Listens to all changes in the users collection, iterating over all document changes, which is inefficient.
Network Usage: Higher network usage due to listening to all changes in the collection.
Complexity: More complex logic due to the need to filter and check each change.
To:
Performance: Only listens to changes for the specific user's document, reducing unnecessary processing.
Network Usage: Lower network usage as it only monitors a single document.
Simplicity: Directly handles the specific user's data, making the logic simpler and more maintainable.
Reliability: Immediate check for document existence improves handling of user state.
Refactored onSnapshot for user role update. Changed z-index for the menu bar that was overlapping on the map chart. And removed some unnecessary code/file.
https://vimeo.com/965787782?share=copy