Skip to content

Commit

Permalink
feat: set local path of workerSrc to PdfLoader (infiniflow#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
cike8899 authored Mar 6, 2024
1 parent fda6678 commit cf3a5c1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
22 changes: 22 additions & 0 deletions web/public/pdfjs-dist/pdf.worker.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion web/src/components/pdf-previewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit cf3a5c1

Please sign in to comment.