File tree Expand file tree Collapse file tree 1 file changed +28
-13
lines changed
packages/gitbook/src/components/SitePage Expand file tree Collapse file tree 1 file changed +28
-13
lines changed Original file line number Diff line number Diff line change @@ -317,19 +317,34 @@ async function resolvePageMetaLinks(
317317 context : GitBookSiteContext ,
318318 pageId : string
319319) : Promise < PageMetaLinks > {
320- const pageMetaLinks = await getDataOrNull (
321- context . changeRequest
322- ? context . dataFetcher . listChangeRequestPageMetaLinks ( {
323- spaceId : context . space . id ,
324- changeRequestId : context . changeRequest . id ,
325- pageId,
326- } )
327- : context . dataFetcher . listSpacePageMetaLinks ( {
328- spaceId : context . space . id ,
329-
330- pageId,
331- } )
332- ) ;
320+ const pageMetaLinks = await ( async ( ) => {
321+ if ( context . changeRequest ) {
322+ return getDataOrNull (
323+ context . dataFetcher . listChangeRequestPageMetaLinks ( {
324+ spaceId : context . space . id ,
325+ changeRequestId : context . changeRequest . id ,
326+ pageId,
327+ } )
328+ ) ;
329+ }
330+
331+ if ( context . revisionId !== context . space . revision ) {
332+ return getDataOrNull (
333+ context . dataFetcher . listRevisionPageMetaLinks ( {
334+ spaceId : context . space . id ,
335+ revisionId : context . revisionId ,
336+ pageId,
337+ } )
338+ ) ;
339+ }
340+
341+ return getDataOrNull (
342+ context . dataFetcher . listSpacePageMetaLinks ( {
343+ spaceId : context . space . id ,
344+ pageId,
345+ } )
346+ ) ;
347+ } ) ( ) ;
333348
334349 if ( pageMetaLinks ) {
335350 const canonicalResolution = pageMetaLinks . canonical
You can’t perform that action at this time.
0 commit comments