diff --git a/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx b/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx index 765e468b7..3b2e321ca 100644 --- a/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx +++ b/frontend/src/components/custom-tools/pdf-viewer/PdfViewer.jsx @@ -36,8 +36,8 @@ function PdfViewer({ fileUrl, highlightData }) { // Jump to page when highlightData changes useEffect(() => { + highlightData = removeZerosAndDeleteIfAllZero(highlightData); // Removing zeros before checking the highlight data condition if (highlightData && highlightData.length > 0) { - highlightData = removeZerosAndDeleteIfAllZero(highlightData); const pageNumber = highlightData[0][0]; // Assume highlightData[0][0] is the page number if (pageNumber !== null && jumpToPage) { setTimeout(() => {