diff options
| author | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-13 16:40:26 -0500 |
|---|---|---|
| committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2021-03-13 16:40:26 -0500 |
| commit | 74c8b78c7119e700655338a32c03f2031186b238 (patch) | |
| tree | 57baf33d9230b7ea6f77addf34becae8faeb63b0 /src/client/views/collections/CollectionDockingView.tsx | |
| parent | 70a5edc6e9a203141b16fd31ee9a1a26ebae2188 (diff) | |
| parent | e20a8916483734bb06d08409b6bc804c2391a289 (diff) | |
minor changes
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionDockingView.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 0c8e26e91..3556e74bc 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -337,7 +337,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { } } if (!e.nativeEvent.cancelBubble && !InteractionUtils.IsType(e, InteractionUtils.TOUCHTYPE) && !InteractionUtils.IsType(e, InteractionUtils.PENTYPE) && - Doc.GetSelectedTool() !== InkTool.Highlighter && Doc.GetSelectedTool() !== InkTool.Pen) { + ![InkTool.Highlighter, InkTool.Pen].includes(CurrentUserUtils.SelectedTool)) { e.stopPropagation(); } } @@ -372,16 +372,17 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { this.props.Document.dockingConfig = json; setTimeout(async () => { - const sublists = DocListCast(this.props.Document[this.props.fieldKey]); - const tabs = Cast(sublists[0], Doc, null); - const other = Cast(sublists[1], Doc, null); + const sublists = await DocListCastAsync(this.props.Document[this.props.fieldKey]); + const tabs = sublists && Cast(sublists[0], Doc, null); + const other = sublists && Cast(sublists[1], Doc, null); const tabdocs = await DocListCastAsync(tabs?.data); const otherdocs = await DocListCastAsync(other?.data); tabs && (Doc.GetProto(tabs).data = new List<Doc>(docs)); const otherSet = new Set<Doc>(); otherdocs?.filter(doc => !docs.includes(doc)).forEach(doc => otherSet.add(doc)); - tabdocs?.filter(doc => !docs.includes(doc)).forEach(doc => otherSet.add(doc)); - other && (Doc.GetProto(other).data = new List<Doc>(Array.from(otherSet.values()))); + tabdocs?.filter(doc => !docs.includes(doc) && doc.type !== DocumentType.KVP).forEach(doc => otherSet.add(doc)); + const vals = Array.from(otherSet.values()).filter(val => val instanceof Doc).map(d => d as Doc).filter(d => d.type !== DocumentType.KVP); + other && (Doc.GetProto(other).data = new List<Doc>(vals)); }, 0); } |
