From af5543f119ec00458012a0dfa881d30751e59d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Tue, 31 May 2022 14:06:41 +0200 Subject: [PATCH] Merge pull request #8224 from overleaf/ta-pdf-detach-wait-i18n PDF Detach: Wait for i18n GitOrigin-RevId: d1774c917ba903eab9980c90dc8b1e41eaf5e935 --- .../pdf-preview/components/pdf-preview-detached-root.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.js b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.js index 1a34c6a41d..f8ba285b03 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.js +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-detached-root.js @@ -1,10 +1,17 @@ import ReactDOM from 'react-dom' import PdfPreview from './pdf-preview' import { ContextRoot } from '../../../shared/context/root-context' +import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n' import { Shortcuts } from './shortcuts' import PdfPreviewDetachedRootSafariWarning from './pdf-preview-detached-root-safari-warning' function PdfPreviewDetachedRoot() { + const { isReady } = useWaitForI18n() + + if (!isReady) { + return null + } + return (