diff options
author | bobzel <zzzman@gmail.com> | 2021-09-01 10:55:01 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-01 10:55:01 -0400 |
commit | 31451c577cfc12736feb6f9e64e72d803cef720a (patch) | |
tree | aaba96a152bd4f761dd6318f9a4bcbc643279a0c /src | |
parent | ef630d51e6407f303992e0672fb110a1009e5223 (diff) |
fixed double clicking on data docs in filesystem to open best alias.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/TreeView.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx index 86fd21677..e8f345782 100644 --- a/src/client/views/collections/TreeView.tsx +++ b/src/client/views/collections/TreeView.tsx @@ -154,8 +154,8 @@ export class TreeView extends React.Component<TreeViewProps> { } else { // choose an appropriate alias or make one. --- choose the first alias that (1) user owns, (2) has no context field ... otherwise make a new alias // this.props.addDocTab(CurrentUserUtils.ActiveDashboard.isShared ? Doc.MakeAlias(this.props.document) : this.props.document, "add:right"); - // choose an appropriate alias or make one -- -- choose the first alias that (1) the user owns, (2) has no context field - if I own it and someone else does not have it open,, otherwise create an alias - this.props.addDocTab(this.props.document, "add:right"); + const bestAlias = DocListCast(this.props.document.aliases).find(doc => !doc.context); + this.props.addDocTab(bestAlias ?? Doc.MakeAlias(this.props.document), "add:right"); } } |