-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hold åpen versjonsvelger #145
Merged
Merged
Conversation
This file contains 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
…ntroduce caching mechanism - Replace localStorage usage with a caching system for version selector state. - Update version selector to utilize cached state and handle component mounting. - Enhance VersionSelector component to support onMount callback for caching rendered instances.
…onent - Introduce content-specific caching for version selector state. - Clear cache when content ID changes to ensure accurate state management. - Update localStorage handling to use dynamic storage keys based on content ID.
- Update cache clearing logic to immediately clear previous content ID when it changes. - Reset local cache state when content ID changes to ensure accurate version data. - Add effect to reset search query in VersionSelector when input versions change.
- Replace local reference for previous content ID with a React ref to improve cache clearing logic. - Ensure cache is cleared immediately when content ID changes, maintaining accurate version data.
- Preserve the isOpen state when resetting the local cache on content ID changes. - Introduce a separate effect to handle data loading without affecting the panel state, ensuring accurate version data is maintained.
- Modify the rendering condition to display either the cached VersionSelector component or a new instance based on availability. - Enhance clarity in the code by improving comments related to component rendering.
- Simplify version selection logic by consolidating URL update conditions. - Ensure the selected version is set correctly based on available data, improving user experience with accurate URL states.
- Remove localStorage handling for version selector state to simplify state management. - Streamline the component by eliminating unnecessary storage key logic and effects. - Ensure the selected version is set correctly without persisting state across sessions.
…omponents - Update cache handling to clear and reset based on content ID changes, ensuring accurate version data. - Simplify the search query reset logic in VersionSelector when versions change, improving user experience. - Streamline the useEffect hooks for better clarity and performance in both components.
- Simplify version ID and URL management logic to enhance clarity and performance. - Consolidate useEffect dependencies for better data handling and state updates. - Improve comments for better understanding of cache management and rendering logic.
This reverts commit cf0aa3e.
This reverts commit 86eae8e.
talepre
reviewed
Mar 21, 2025
|
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.
Oppsummering av hva som er gjort