From a3b01659a4dd624ed9fca98812b80f05027b0982 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Mon, 14 Feb 2022 15:20:06 +0100 Subject: [PATCH] Fix `isRequired` error in `GoToCodeButton.propTypes` (#6646) Skip `PdfSynctexControls` rendering until `position` is set GitOrigin-RevId: ea40c7f98ea3bbdf3d8689175658d2c014b68436 --- .../features/pdf-preview/components/pdf-synctex-controls.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.js b/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.js index 7f1bc193bc..3a17481554 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.js +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.js @@ -312,6 +312,10 @@ function PdfSynctexControls() { } }, [syncToCode]) + if (!position) { + return null + } + if (!pdfExists || pdfViewer === 'native') { return null }