diff options
author | Monika <monika_hedman@brown.edu> | 2019-06-21 11:37:28 -0400 |
---|---|---|
committer | Monika <monika_hedman@brown.edu> | 2019-06-21 11:37:28 -0400 |
commit | 7eb3e346c6fddc23794f3dd0c33e280c4ee7bc24 (patch) | |
tree | d6e9ecd9d02aabd5324586c027ec769b750e0b6e /src/client/util/DocumentManager.ts | |
parent | 4b8a6b7a76ccadfd39ec037e282018c7d588dea8 (diff) | |
parent | 179afa6e80631fcb8899408c3961bf1757e5b19b (diff) |
pulled from master
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 40928ecae..cd4e90f2d 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -59,9 +59,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; } @@ -69,7 +69,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; } }); |