diff --git a/app/app.vue b/app/app.vue index c3519a4..49dea9d 100644 --- a/app/app.vue +++ b/app/app.vue @@ -7,16 +7,22 @@ const { seo, docs } = useAppConfig() const content = useDocsContent() const route = useRoute() -const [{ data: navigation }, { data: sha }] = await Promise.all([ - useAsyncData('navigation', () => content.value.client.navigation(), { - watch: [() => content.value.routeBase], - }), - useAsyncData( - () => `content-head:${content.value.apiBase}`, - () => $fetch<{ sha: string | null }>(`${content.value.apiBase}/head`).then(({ sha }) => sha), - { default: () => null, watch: [() => content.value.apiBase] } - ), -]) +const { data: navigation } = await useAsyncData('navigation', () => content.value.client.navigation(), { + watch: [() => content.value.routeBase], +}) + +// Client-only: an SSR value gets baked into the page's ISR entry and would pin search to a stale commit. +const { data: sha } = useAsyncData( + () => `content-head:${content.value.apiBase}`, + () => + $fetch<{ sha: string | null }>(`${content.value.apiBase}/head`) + .then(({ sha }) => sha) + .catch((error) => { + console.error('[search] could not resolve the content head', error) + return null + }), + { server: false, watch: [() => content.value.apiBase] } +) const nuxtApp = useNuxtApp() const navTree = computed(() => prefixNavigation(navigation.value ?? [], content.value.routeBase)) diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index eb28c7c..983e5e7 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -4,7 +4,6 @@ const content = useDocsContent() const historyOpen = useVersionHistory() const assistantOpen = useAssistant() const navigation = useMainNavigation() -const { available: searchAvailable } = useSearch()