Skip to content

Commit

Permalink
feat(#679): update menu when logged in on static (#681)
Browse files Browse the repository at this point in the history
* feat(#679): update menu when logged in on static

* chore(#679): update mounted hook
  • Loading branch information
Decipher authored Nov 8, 2023
1 parent 7c282de commit 6298025
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-birds-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"druxt-menu": patch
---

feat(#679): update menu items when logged in on static generated site
8 changes: 8 additions & 0 deletions packages/menu/src/components/DruxtMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@ export default {
},
},
mounted() {
// If logged in and statically generated, re-fetch the menu.
if (this?.$auth?.loggedIn && this?.$store?.app?.context?.isStatic) {
const settings = this.$options.druxt.settings(this, this.component.settings)
this.$options.druxt.fetchData.call(this, settings)
}
},
methods: {
/**
* Recursively gets required menu items from the Vuex store.
Expand Down

0 comments on commit 6298025

Please sign in to comment.