feat: set local path of workerSrc to PdfLoader (#101)

This commit is contained in:
balibabu 2024-03-06 12:12:32 +08:00 committed by GitHub
parent d7c362f237
commit 16eade4c48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 2 deletions

22
web/public/pdfjs-dist/pdf.worker.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -54,7 +54,11 @@ const DocumentPreviewer = ({ chunk, documentId, visible }: IProps) => {
return (
<div className={styles.documentContainer}>
<PdfLoader url={url} beforeLoad={<Skeleton active />}>
<PdfLoader
url={url}
beforeLoad={<Skeleton active />}
workerSrc="/pdfjs-dist/pdf.worker.min.js"
>
{(pdfDocument) => (
<PdfHighlighter
pdfDocument={pdfDocument}

View File

@ -43,7 +43,11 @@ const Preview = ({ selectedChunkId }: IProps) => {
return (
<div className={styles.documentContainer}>
<PdfLoader url={url} beforeLoad={<Skeleton active />}>
<PdfLoader
url={url}
beforeLoad={<Skeleton active />}
workerSrc="/pdfjs-dist/pdf.worker.min.js"
>
{(pdfDocument) => (
<PdfHighlighter
pdfDocument={pdfDocument}