diff options
| author | bobzel <zzzman@gmail.com> | 2020-09-16 11:40:25 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-09-16 11:40:25 -0400 |
| commit | 4fc10a64e35234da2dafd03c3f53f5e080e754d2 (patch) | |
| tree | 02e70ed9d3804e613e8c132a50494bf9d95b5e71 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | |
| parent | c48a087c2bc637d3bf792486806bbc33ddb8d2d7 (diff) | |
cleaned up TabDocView a bit
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 1cae12a9d..de48821af 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -372,12 +372,12 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P } } - getClusterColor = (doc: Doc) => { + getClusterColor = (doc: Opt<Doc>) => { let clusterColor = this.props.backgroundColor?.(doc, this.props.renderDepth + 1); - const cluster = NumCast(doc.cluster); + const cluster = NumCast(doc?.cluster); if (this.Document._useClusters) { if (this._clusterSets.length <= cluster) { - setTimeout(() => this.updateCluster(doc), 0); + setTimeout(() => doc && this.updateCluster(doc), 0); } else { // choose a cluster color from a palette const colors = ["#da42429e", "#31ea318c", "rgba(197, 87, 20, 0.55)", "#4a7ae2c4", "rgba(216, 9, 255, 0.5)", "#ff7601", "#1dffff", "yellow", "rgba(27, 130, 49, 0.55)", "rgba(0, 0, 0, 0.268)"]; |
