mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Clear PDF file container element before rendering (#16028)
GitOrigin-RevId: acec635bc1bbd47bf76f6a15151fefc0831fa541
This commit is contained in:
@@ -35,6 +35,14 @@ const FileViewPdf: FC<{
|
|||||||
|
|
||||||
const pdf = await PDFJS.getDocument(preview.url).promise
|
const pdf = await PDFJS.getDocument(preview.url).promise
|
||||||
|
|
||||||
|
// bail out if loading the PDF took too long
|
||||||
|
if (!mountedRef.current) {
|
||||||
|
onError()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
element.textContent = '' // ensure the element is empty
|
||||||
|
|
||||||
const scale = window.devicePixelRatio || 1
|
const scale = window.devicePixelRatio || 1
|
||||||
|
|
||||||
for (let i = 1; i <= pdf.numPages; i++) {
|
for (let i = 1; i <= pdf.numPages; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user