diff options
author | Fawn <fangrui_tong@brown.edu> | 2019-06-20 11:31:15 -0400 |
---|---|---|
committer | Fawn <fangrui_tong@brown.edu> | 2019-06-20 11:31:15 -0400 |
commit | cd2db5bf11fb89e3cd7016f7f798d65698c74c5e (patch) | |
tree | 9e46a9a6b940720e68eb1f390dacecae3f4730a8 /src/client/util/DocumentManager.ts | |
parent | 73f03785f938542a91b28b35043f2feda2bc1432 (diff) | |
parent | e9d62f4ca0dbeb57e46239047041a8a04da7b504 (diff) |
merge
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r-- | src/client/util/DocumentManager.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index 85f8bf751..bb87d09ec 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -36,9 +36,9 @@ export class DocumentManager { let toReturn: DocumentView | null = null; let passes = preferredCollection ? [preferredCollection, undefined] : [undefined]; - for (let i = 0; i < passes.length; i++) { + for (let pass of passes) { DocumentManager.Instance.DocumentViews.map(view => { - if (view.props.Document[Id] === id && (!passes[i] || view.props.ContainingCollectionView === preferredCollection)) { + if (view.props.Document[Id] === id && (!pass || view.props.ContainingCollectionView === preferredCollection)) { toReturn = view; return; } @@ -46,7 +46,7 @@ export class DocumentManager { if (!toReturn) { DocumentManager.Instance.DocumentViews.map(view => { let doc = view.props.Document.proto; - if (doc && doc[Id] === id && (!passes[i] || view.props.ContainingCollectionView === preferredCollection)) { + if (doc && doc[Id] === id && (!pass || view.props.ContainingCollectionView === preferredCollection)) { toReturn = view; } }); |