@@ -5,6 +5,7 @@ import { getEmotionCache } from '../client/islands/emotion';
55import { initHydration } from '../client/islands/initHydration' ;
66import { useApi } from '../lib/useApi' ;
77import type { LiveUpdateType } from '../types/liveBlog' ;
8+ import type { RenderingTarget } from '../types/renderingTarget' ;
89import { Toast } from './Toast' ;
910
1011type Props = {
@@ -17,6 +18,7 @@ type Props = {
1718 webURL : string ;
1819 mostRecentBlockId : string ;
1920 hasPinnedPost : boolean ;
21+ renderingTarget : RenderingTarget ;
2022} ;
2123
2224/**
@@ -154,6 +156,7 @@ export const Liveness = ({
154156 webURL,
155157 mostRecentBlockId,
156158 hasPinnedPost,
159+ renderingTarget,
157160} : Props ) => {
158161 const [ showToast , setShowToast ] = useState ( false ) ;
159162 const [ topOfBlogVisible , setTopOfBlogVisible ] = useState < boolean > ( ) ;
@@ -309,9 +312,15 @@ export const Liveness = ({
309312 revealPendingBlocks ( ) ;
310313 setNumHiddenBlocks ( 0 ) ;
311314 } else {
312- window . location . href = `${ webURL } #${ placeToScrollTo } ` ;
315+ const url = new URL ( webURL ) ;
316+ if ( renderingTarget === 'Apps' ) {
317+ url . searchParams . set ( 'dcr' , 'apps' ) ;
318+ }
319+ url . hash = placeToScrollTo ;
320+
321+ window . location . href = url . href ;
313322 }
314- } , [ hasPinnedPost , onFirstPage , webURL ] ) ;
323+ } , [ hasPinnedPost , onFirstPage , webURL , renderingTarget ] ) ;
315324
316325 if ( toastRoot && showToast ) {
317326 /**
0 commit comments