feat: Add navigation sidebar to shared documents (#2899)

Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
Nan Yu
2022-01-14 19:02:01 -08:00
committed by GitHub
parent 2ad32e5009
commit 71820fb3ad
18 changed files with 408 additions and 158 deletions

View File

@@ -36,8 +36,6 @@ type Props = RootStore &
children: (arg0: any) => React.ReactNode;
};
const sharedTreeCache = {};
@observer
class DataLoader extends React.Component<Props> {
sharedTree: NavigationNode | null | undefined;
@@ -58,7 +56,7 @@ class DataLoader extends React.Component<Props> {
const { documents, match } = this.props;
this.document = documents.getByUrl(match.params.documentSlug);
this.sharedTree = this.document
? sharedTreeCache[this.document.id]
? documents.getSharedTree(this.document.id)
: undefined;
this.loadDocument();
}
@@ -192,7 +190,6 @@ class DataLoader extends React.Component<Props> {
);
this.sharedTree = response.sharedTree;
this.document = response.document;
sharedTreeCache[this.document.id] = response.sharedTree;
if (revisionId && revisionId !== "latest") {
await this.loadRevision();