diff options
| author | monikahedman <monika_hedman@brown.edu> | 2019-08-23 22:32:33 -0400 |
|---|---|---|
| committer | monikahedman <monika_hedman@brown.edu> | 2019-08-23 22:32:33 -0400 |
| commit | 219ef9dd1d8e916ea4b1f843021b879c10be3418 (patch) | |
| tree | bf19577c46776faee69724d395770195d79c61f7 /src | |
| parent | 1b5a75b39b6588ce02e4579961a01316627cf47f (diff) | |
it is PRETTY
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/views/linking/LinkFollowBox.tsx | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/client/views/linking/LinkFollowBox.tsx b/src/client/views/linking/LinkFollowBox.tsx index f78446771..da04b1292 100644 --- a/src/client/views/linking/LinkFollowBox.tsx +++ b/src/client/views/linking/LinkFollowBox.tsx @@ -58,36 +58,18 @@ export class LinkFollowBox extends React.Component<FieldViewProps> { () => LinkFollowBox.destinationDoc, async newLinkDestination => { if (LinkFollowBox.destinationDoc && this.sourceView && this.sourceView.props.ContainingCollectionView) { - let colView = this.sourceView.props.ContainingCollectionView; - let colDoc = colView.props.Document; - let shouldReturn = true; + let colDoc = this.sourceView.props.ContainingCollectionView.props.Document; + runInAction(() => { this.canPan = false; }); if (colDoc.viewType && colDoc.viewType === 1) { //this means its in a freeform collection let docs = Cast(colDoc.data, listSpec(Doc), []); let aliases = await SearchUtil.GetViewsOfDocument(Doc.GetProto(LinkFollowBox.destinationDoc)); aliases.forEach(alias => { - let docs2 = docs; - let res = docs2.filter(doc => doc === alias); - if (res.length > 0) { - runInAction(() => { - this.canPan = true; - shouldReturn = false; - }); - } + if (docs.filter(doc => doc === alias).length > 0) { runInAction(() => { this.canPan = true; }); } }); - - if (shouldReturn) { - runInAction(() => { this.canPan = false; }); - } - } - else { - runInAction(() => { this.canPan = false; }); } } - else { - runInAction(() => { this.canPan = false; }); - } } ); } |
