From be64c2b2066be8fb1018ebc5fb8ae6086cd18a40 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 18 Sep 2021 17:49:00 -0700 Subject: [PATCH] fix: Restore load cache, fixes TOC not visible on load --- .../Document/components/MultiplayerEditor.js | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/app/scenes/Document/components/MultiplayerEditor.js b/app/scenes/Document/components/MultiplayerEditor.js index 94fc414f7..04873b75e 100644 --- a/app/scenes/Document/components/MultiplayerEditor.js +++ b/app/scenes/Document/components/MultiplayerEditor.js @@ -21,7 +21,7 @@ type Props = {| id: string, |}; -function MultiplayerEditor(props: Props, ref: any) { +function MultiplayerEditor({ ...props }: Props, ref: any) { const documentId = props.id; const history = useHistory(); const { t } = useTranslation(); @@ -128,14 +128,24 @@ function MultiplayerEditor(props: Props, ref: any) { return ; } + // while the collaborative document is loading, we render a version of the + // document from the last text cache in read-only mode if we have it. + const showCache = !isLocalSynced && !isRemoteSynced; + return ( - + <> + {showCache && ( + + )} + + ); }