Closed Decipher closed 6 months ago
Latest commit: 273a630d6ee79a812aa68a198ecdea984dad4b3d
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The DruxtMenu component has been updated to enhance cache management for logged-in users on statically generated sites. It now includes functionality to clear specific menu-related entities from the Vuex state before fetching new menu data. This ensures that users see the most current menu information without old data interfering.
File Path | Change Summary |
---|---|
.packages/menu/src/components/DruxtMenu.vue, .changeset/happy-ties-rule.md |
Added a commit to flush entities with a specific prefix before fetching menu data if logged in and statically generated. |
.packages/menu/src/stores/menu.js, .test/stores/menu.test.js |
Modified DruxtMenuStore to include a new flushEntities mutator function, which removes JSON:API menu item entities from the Vuex state object. This function takes a prefix parameter and can be used to flush all menu entities or entities for a specific prefix. Added tests for the AddEntities and flushEntities functions in the DruxtStore to verify the behavior of adding and flushing entities in the druxtMenu store. |
🐇💻✨
In the code burrow, deep and vast,
A rabbit tweaked the menu's past.
Old data flushed, the new shall last,
Ensuring menus are unsurpassed. 🍃🥕
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
96d693d
) 96.14% compared to head (273a630
) 96.23%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Types of changes
Description
Adds druxtMenu/flushEntities Vuex mutation to allow the menu vuex store to be flushed when logging in/out with an authenticated user.
Checklist:
Screenshots/Media:
Summary by CodeRabbit
New Features
Refactor