perf: Navigation of shared trees feels slow (#3171)

* perf: Navigation of shared trees feels slow

* remove redundant call to setActiveDocument

Co-authored-by: Nan Yu <thenanyu@gmail.com>
This commit is contained in:
Tom Moor
2022-03-01 21:51:51 -08:00
committed by GitHub
parent 3ac125d560
commit 4468d29740
4 changed files with 67 additions and 11 deletions

View File

@@ -124,7 +124,13 @@ class UiStore {
};
@action
setActiveDocument = (document: Document): void => {
setActiveDocument = (document: Document | string): void => {
if (typeof document === "string") {
this.activeDocumentId = document;
this.observingUserId = undefined;
return;
}
this.activeDocumentId = document.id;
this.observingUserId = undefined;