diff --git a/packages/web/components/templates/article/PdfArticleContainer.tsx b/packages/web/components/templates/article/PdfArticleContainer.tsx index d35046312..dfbbcabf5 100644 --- a/packages/web/components/templates/article/PdfArticleContainer.tsx +++ b/packages/web/components/templates/article/PdfArticleContainer.tsx @@ -35,8 +35,9 @@ export default function PdfArticleContainer( const containerRef = useRef(null) const [notebookKey, setNotebookKey] = useState(uuidv4()) const [noteTarget, setNoteTarget] = useState(undefined) - const [noteTargetPageIndex, setNoteTargetPageIndex] = - useState(undefined) + const [noteTargetPageIndex, setNoteTargetPageIndex] = useState< + number | undefined + >(undefined) const highlightsRef = useRef([]) const annotationOmnivoreId = (annotation: Annotation): string | undefined => { @@ -448,6 +449,11 @@ export default function PdfArticleContainer( document.dispatchEvent(new Event('openOriginalArticle')) break case 'u': + const navReturn = window.sessionStorage.getItem('nav-return') + if (navReturn) { + window.location.assign(navReturn) + return + } const query = window.sessionStorage.getItem('q') if (query) { window.location.assign(`/home?${query}`)