diff options
| author | geireann <geireann.lindfield@gmail.com> | 2021-09-01 15:55:37 -0400 |
|---|---|---|
| committer | geireann <geireann.lindfield@gmail.com> | 2021-09-01 15:55:37 -0400 |
| commit | 52c0e8f10555fc8ba05ce62bede60e50b33bdc54 (patch) | |
| tree | 7b6e696d97a2f9ab5c761e973b197bd8d86644e9 /src/client/views/collections/TreeView.tsx | |
| parent | 4ba82ba609d51354958e8346c65673c4cf172c52 (diff) | |
| parent | c8b3de89219a07d466151f5b4633cc87f0d46ec3 (diff) | |
Merge branch 'menu_updates_geireann' of https://github.com/brown-dash/Dash-Web into menu_updates_geireann
Diffstat (limited to 'src/client/views/collections/TreeView.tsx')
| -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..b9487054b 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 && doc.author === Doc.CurrentUserEmail); + this.props.addDocTab(bestAlias ?? Doc.MakeAlias(this.props.document), "add:right"); } } |
