diff options
| author | Eric <ericmabr@gmail.com> | 2023-08-13 16:08:28 -0400 |
|---|---|---|
| committer | Eric <ericmabr@gmail.com> | 2023-08-13 16:08:28 -0400 |
| commit | 0020ec69b847c8607affb57babddfddc812dc9b6 (patch) | |
| tree | e24255039015745d2073806bee97ce449ddb5260 /src/client/views/PropertiesDocContextSelector.tsx | |
| parent | 7b2553514bb000eb7f618eb0f0d653baee78742c (diff) | |
| parent | 3b45f1d30a947dc1702ec347b83e98374c5b603c (diff) | |
Merge branch 'master' into UI_Update_Eric_Ma
Diffstat (limited to 'src/client/views/PropertiesDocContextSelector.tsx')
| -rw-r--r-- | src/client/views/PropertiesDocContextSelector.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/PropertiesDocContextSelector.tsx b/src/client/views/PropertiesDocContextSelector.tsx index 12a09196e..d157e7b1c 100644 --- a/src/client/views/PropertiesDocContextSelector.tsx +++ b/src/client/views/PropertiesDocContextSelector.tsx @@ -3,11 +3,10 @@ import { observer } from 'mobx-react'; import * as React from 'react'; import { Doc, DocListCast } from '../../fields/Doc'; import { Id } from '../../fields/FieldSymbols'; -import { Cast, NumCast, StrCast } from '../../fields/Types'; -import { CollectionViewType } from '../documents/DocumentTypes'; +import { Cast, StrCast } from '../../fields/Types'; import { DocFocusOrOpen } from '../util/DocumentManager'; import { CollectionDockingView } from './collections/CollectionDockingView'; -import { DocumentView, OpenWhere, OpenWhereMod } from './nodes/DocumentView'; +import { DocumentView, OpenWhere } from './nodes/DocumentView'; import './PropertiesDocContextSelector.scss'; type PropertiesDocContextSelectorProps = { @@ -39,6 +38,7 @@ export class PropertiesDocContextSelector extends React.Component<PropertiesDocC }, new Set<Doc>()) .keys() ); + return doclayouts .filter(doc => !Doc.AreProtosEqual(doc, CollectionDockingView.Instance?.props.Document)) .filter(doc => !Doc.IsSystem(doc)) @@ -48,11 +48,12 @@ export class PropertiesDocContextSelector extends React.Component<PropertiesDocC getOnClick = (col: Doc, target: Doc) => { if (!this.props.DocView) return; - col = Doc.IsDocDataProto(col) ? Doc.MakeDelegate(col) : col; + col = Doc.IsDataProto(col) ? Doc.MakeDelegate(col) : col; DocFocusOrOpen(Doc.GetProto(this.props.DocView.props.Document), undefined, col); }; render() { + if (this._docs.length < 1) return undefined; return ( <div> {this.props.hideTitle ? null : <p key="contexts">Contexts:</p>} |
