aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-12 17:49:35 -0500
committerbobzel <zzzman@gmail.com>2021-03-12 17:49:35 -0500
commit2a17392bd461bfdc669961c5bf8892b7cb6958d6 (patch)
tree441ca5ae1bdf5f52fe4b06e0a98d19eb5b512149 /src/client/views/collections/CollectionView.tsx
parent75194d8218e1747d177ec018e3cf025b8d8906bc (diff)
trying to make treeViews more efficient by making fewer calls to Get document fields getter.
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index f903128d7..aa45f49c4 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -103,13 +103,15 @@ export class CollectionView extends Touchable<CollectionViewProps> {
return viewField as any as CollectionViewType;
}
- active = (outsideReaction?: boolean) => (this.props.isSelected(outsideReaction) ||
- this.props.rootSelected(outsideReaction) ||
- (this.props.layerProvider?.(this.props.Document) !== false && (this.props.Document.forceActive || this.props.Document._isGroup)) ||
- this._isChildActive ||
- this.props.renderDepth === 0) ?
- true :
- false
+ active = (outsideReaction?: boolean) => {
+ return this.props.renderDepth === 0 ||
+ this.props.isSelected(outsideReaction) ||
+ this.props.rootSelected(outsideReaction) ||
+ (this.props.layerProvider?.(this.props.Document) !== false && (this.props.Document.forceActive || this.props.Document._isGroup)) ||
+ this._isChildActive ?
+ true :
+ false;
+ }
whenActiveChanged = (isActive: boolean) => this.props.whenActiveChanged(this._isChildActive = isActive);