From 80ff682ec6d3de6b3674617dbf4928706ef983b1 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 13 Aug 2021 18:14:55 -0700 Subject: [PATCH] fix: Use static docs for archived,trash,revisions --- .flowconfig | 1 + app/scenes/Document/components/DataLoader.js | 2 ++ app/scenes/Document/components/Document.js | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.flowconfig b/.flowconfig index db31da391f..7e630b5656 100644 --- a/.flowconfig +++ b/.flowconfig @@ -14,6 +14,7 @@ .*/node_modules/yjs/.* .*/node_modules/y-prosemirror/.* .*/node_modules/y-protocols/.* +.*/node_modules/y-indexeddb/.* .*/node_modules/lib0/.* .*/server/scripts/.* *.test.js diff --git a/app/scenes/Document/components/DataLoader.js b/app/scenes/Document/components/DataLoader.js index e33f987db4..d55f248e2f 100644 --- a/app/scenes/Document/components/DataLoader.js +++ b/app/scenes/Document/components/DataLoader.js @@ -248,6 +248,8 @@ class DataLoader extends React.Component { const abilities = policies.abilities(document.id); + // We do not want to remount the document when changing from view->edit + // on the multiplayer flag as the doc is guaranteed to be upto date. const key = team.features.multiplayerEditor ? "" : this.isEditing diff --git a/app/scenes/Document/components/Document.js b/app/scenes/Document/components/Document.js index 1ee960d1ae..d90b652bce 100644 --- a/app/scenes/Document/components/Document.js +++ b/app/scenes/Document/components/Document.js @@ -363,6 +363,12 @@ class DocumentScene extends React.Component { : []; const showContents = ui.tocVisible && readOnly; + const multiplayerEditor = + team?.features?.multiplayerEditor && + !document.isArchived && + !document.isDeleted && + !revision; + return ( { id={document.id} key={disableEmbeds ? "disabled" : "enabled"} innerRef={this.editor} - multiplayer={team?.features?.multiplayerEditor} + multiplayer={multiplayerEditor} shareId={shareId} isDraft={document.isDraft} template={document.isTemplate}