aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-07-19 13:39:22 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-07-19 13:39:22 -0400
commit984db272dc37fc827291010796f300e8745eddf2 (patch)
tree8ec56aa04f32a3edd0a2a8413a3d4b09dac7769b /src/client/util/DocumentManager.ts
parentb24babcd89d51e7f6461c57ac16701630c86cf87 (diff)
parentd7a3e39e901054d0308df158cfa578a94f80c467 (diff)
Merge branch 'master' into collaboration-again
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index b921b3116..8e4e0d8f3 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -1,10 +1,11 @@
import { action, computed, observable, ObservableSet } from 'mobx';
-import { Doc, Opt } from '../../fields/Doc';
-import { Animation } from '../../fields/DocSymbols';
+import { Doc, DocListCast, Opt } from '../../fields/Doc';
+import { AclAdmin, AclEdit, Animation } from '../../fields/DocSymbols';
import { Id } from '../../fields/FieldSymbols';
import { listSpec } from '../../fields/Schema';
import { Cast, DocCast, StrCast } from '../../fields/Types';
import { AudioField } from '../../fields/URLField';
+import { GetEffectiveAcl } from '../../fields/util';
import { CollectionViewType } from '../documents/DocumentTypes';
import { CollectionDockingView } from '../views/collections/CollectionDockingView';
import { TabDocView } from '../views/collections/TabDocView';
@@ -344,6 +345,9 @@ export function DocFocusOrOpen(doc: Doc, options: DocFocusOptions = { willZoomCe
});
}
};
+ if (Doc.IsDataProto(doc) && DocListCast(doc.proto_embeddings).some(embed => embed.hidden && [AclAdmin, AclEdit].includes(GetEffectiveAcl(embed)))) {
+ doc = DocListCast(doc.proto_embeddings).find(embed => embed.hidden && [AclAdmin, AclEdit].includes(GetEffectiveAcl(embed)))!;
+ }
if (doc.hidden) {
doc.hidden = false;
options.toggleTarget = false;