Skip to content

Commit 35f2043

Browse files
authored
fix: Fix page-State key across page-loads so data is re-rendered during client-side navigation (#135)
1 parent 98e9f73 commit 35f2043

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/composables/useDrupalCe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const useDrupalCe = () => {
3131
const nuxtApp = useNuxtApp()
3232

3333
// Workaround for issue - useState is not available after async call (Nuxt instance unavailable)
34-
const pageState = useState(`page-${path}`, () => {})
34+
const pageState = useState('drupal-ce-page-data', () => {})
3535
useFetchOptions.key = `page-${path}`
3636
useFetchOptions = processFetchOptions(useFetchOptions)
3737

@@ -92,7 +92,7 @@ export const useDrupalCe = () => {
9292
/**
9393
* Use page data
9494
*/
95-
const getPage = () => useState(`page-${useRoute().path}`)
95+
const getPage = () => useState('drupal-ce-page-data')
9696

9797
/**
9898
* Render elements from page data returned from fetchPage

0 commit comments

Comments
 (0)