Improve loading states and fix authentication data fetching#48
Merged
Conversation
7922447 to
8e76ef7
Compare
- Update store configuration to use redux-persist instead of redux-localstorage - Add PersistGate wrapper component for state rehydration - Configure whitelist-based persistence for better control over persisted state
- Add loading state tracking to Redux store with initial states for unit/service - Implement GET_RESOURCE_START action to set loading states to true - Update dataReducer to handle loading state transitions and normalize state structure - Modify Dashboard component to use loading state instead of checking for undefined data - Add setResourceFetchStart action dispatch in Main component before fetch operations
- Add reset parameter to getInitialLocation() to reset currentStage - Fix bug where geolocation wouldn't work after login due to persistent currentStage - Ensure getNearestUnits() is called properly on subsequent app sessions - Pass reset=true explicitly when calling getInitialLocation in Main component
871919a to
7ebe828
Compare
unnecessary import
7ebe828 to
8269783
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Implements proper loading state management and fixes race conditions in data fetching when user authentication state changes.
Key Changes
Fixes