Removal of non-collaborative editing code paths (#4210)

This commit is contained in:
Tom Moor
2023-03-28 22:13:42 -04:00
committed by GitHub
parent 3108a26793
commit 7ba6a9379b
27 changed files with 45 additions and 552 deletions

View File

@@ -30,7 +30,6 @@ type Children = (options: {
document: Document;
revision: Revision | undefined;
abilities: Record<string, boolean>;
isEditing: boolean;
readOnly: boolean;
onCreateLink: (title: string) => Promise<string>;
sharedTree: NavigationNode | undefined;
@@ -186,21 +185,12 @@ function DataLoader({ match, children }: Props) {
);
}
// 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.collaborativeEditing
? ""
: isEditing
? "editing"
: "read-only";
return (
<React.Fragment key={key}>
<React.Fragment>
{children({
document,
revision,
abilities: can,
isEditing,
readOnly:
!isEditing || !can.update || document.isArchived || !!revisionId,
onCreateLink,