mirror of
https://github.com/MAKS-IT-COM/maksit-certs-ui.git
synced 2026-04-01 07:12:09 +02:00
(bugfix): in release pdf is not loaded
This commit is contained in:
parent
c971ee94b2
commit
05821bdea5
@ -9,6 +9,10 @@ import 'react-pdf/dist/Page/AnnotationLayer.css'
|
|||||||
import 'react-pdf/dist/Page/TextLayer.css'
|
import 'react-pdf/dist/Page/TextLayer.css'
|
||||||
|
|
||||||
import type { PDFDocumentProxy } from 'pdfjs-dist'
|
import type { PDFDocumentProxy } from 'pdfjs-dist'
|
||||||
|
import pdfWorkerUrl from 'pdfjs-dist/build/pdf.worker.min.mjs?url'
|
||||||
|
|
||||||
|
// pdfjs-dist worker (bundled asset URL for prod)
|
||||||
|
pdfjs.GlobalWorkerOptions.workerSrc = pdfWorkerUrl
|
||||||
|
|
||||||
const LetsEncryptTermsOfService: FC = () => {
|
const LetsEncryptTermsOfService: FC = () => {
|
||||||
|
|
||||||
@ -20,11 +24,6 @@ const LetsEncryptTermsOfService: FC = () => {
|
|||||||
const containerRef = useRef<HTMLDivElement>(null)
|
const containerRef = useRef<HTMLDivElement>(null)
|
||||||
const [containerWidth, setContainerWidth] = useState<number>()
|
const [containerWidth, setContainerWidth] = useState<number>()
|
||||||
|
|
||||||
// Set up pdfjs worker
|
|
||||||
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
|
|
||||||
'pdfjs-dist/build/pdf.worker.min.mjs',
|
|
||||||
import.meta.url,
|
|
||||||
).toString()
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleResize = () => {
|
const handleResize = () => {
|
||||||
if (containerRef.current) {
|
if (containerRef.current) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user