Skip to content

Commit

Permalink
feat(#679): update menu when logged in on static
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Nov 5, 2023
1 parent f8c6b57 commit 13d0f73
Show file tree
Hide file tree
Showing 2 changed files with 14 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
9 changes: 9 additions & 0 deletions packages/menu/src/components/DruxtMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@ export default {
},
},
mounted() {
// If logged in and statically generated, re-fetch the menu.
if ((this.$auth || {}).loggedIn && this.$store.app.context.isStatic) {
this.value = undefined
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 13d0f73

Please sign in to comment.