diff --git a/src/runtime/composables/useDrupalCe/index.ts b/src/runtime/composables/useDrupalCe/index.ts index 749972e..d499db1 100644 --- a/src/runtime/composables/useDrupalCe/index.ts +++ b/src/runtime/composables/useDrupalCe/index.ts @@ -264,7 +264,10 @@ export const useDrupalCe = () => { pageRef.value.key = useFetchOptions.key // Store the current page key for getPage() lookup - currentPageKey.value = useFetchOptions.key + // Only update once page data exists to avoid transient empty-page states + if (pageRef.value) { + currentPageKey.value = useFetchOptions.key + } return pageRef } @@ -601,7 +604,7 @@ export const useDrupalCe = () => { getMenuBaseUrl, getPageLayout, usePageHead, - + } }